Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <h1 id="logo">
- <?php
- $in_news = 0; // set a flag varable to false
- if( is_category() && in_array( '23', get_ancestors( get_query_var('cat'), 'category' ) ) ) $in_news = 1; // set flag to true
- if( is_single() ) {
- $cats = get_the_category();
- foreach ( $cats as $cat ) {
- if( in_array( '20', get_ancestors( $cat, 'category' ) ) ) $in_news = 1; // set flag to true
- }
- }
- if( $in_news == 1 || is_category(23)) : ?>
- <a href="http://localhost/test"><img width="345" height="176" src="http://localhost/test/wp-content/uploads/logo-old.png"></a>
- <?php else : ?>
- <a href="http://localhost/test"><img width="345" height="176" src="http://localhost/test/wp-content/uploads/logo.png"></a>
- <?php endif; ?>
- </h1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement