Not working: if is_page()
-
Hey!
I’m trying add header facebook og:title for my theme.
That’s the code:
add_action( 'wp_head', 'rotisoft_meta_cim' ); function rotisoft_meta_cim() { echo '<meta property="og:title" content="'; if ( is_page('117') ) { echo "Blog Site Title"; } elseif ( is_front_page() ) { bloginfo( 'name' ); echo " | MySyite description"; } elseif ( is_page() ) { echo "MySite | "; echo get_the_title(); } elseif ( is_category() ) { echo "Mysite Category: "; single_cat_title(); } elseif ( is_tag() ) { echo "MySite tag: "; single_tag_title(''); } elseif ( is_single() ) { bloginfo( 'name' ); echo " | "; the_title(); } else { bloginfo( 'name' ); echo " | "; the_title(); } echo '">' . "\n" ; }
The problem: When i’m look the 117 id’s site, the title is the latest blog post title. (Don’t the _Blog Site Title_.)
I’m testing thats codes:
if ( is_page(117,'blog','Blog') )
I’m read that page: https://codex.www.ads-software.com/Function_Reference/is_page
But, i’m don’t know, what is the problem. ??Thx for help!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Not working: if is_page()’ is closed to new replies.