Conditional Content in Footer
-
I’m using WP as a CMS for a very large website. There are 12 different locations and each one needs their own contact info to display in the footer. Conditionals are no problem. I’m using a combination of tree, category and home conditionals and I can get text to echo without a hitch.
<?php wp_reset_query(); global $post; if (is_home()) { echo 'Home'; } elseif (is_tree(10)) { echo 'Bridgeport YMCA'; } elseif (is_category('bridgeport')) { echo 'Bridgeport Category'; } else { echo 'General'; } ?>
The problem is that I need to display content based on a certain page ID. I do this sort of thing elsewhere on the site with no problems, but I’m having a hard time getting this right within a conditional statement. I’ve scoured the Codex and something is missing for me. If someone could give me a nudge in the right direction, I’d appreciate it.
I’ve tried a couple of different methods. I’m sure that I must not be calling the page content correctly, but I can’t find an example that works out for me.
else { query_posts('page_id=53'); the_content(); }
else { get_page(53); echo apply_filters( 'the_content' , $post_id_53->post_content ); }
- The topic ‘Conditional Content in Footer’ is closed to new replies.