If Page Code with Custom Variable
-
I’m attempting to pull in a custom variable from a specific post (Youtube Embed).
The code works on the home page, but not on the inside pages.
<?php if ( is_page(24) ) { // This is Podcast echo get_post_meta(570, "Youtube Video", true); } else if ( is_page(25) ){ // This is Video echo get_post_meta(568, "Youtube Video", true); } else if ( is_page(26) ){ // This is the Home Page echo get_post_meta(550, "Youtube Video", true); } else { //Other Pages } ?>
This code works on the home page with both the conditional of page 26 or using the if (is_front_page() ) conditional.
I can change the post meta call to any of these three for the home page and it works… So I know all of the custom variables there there and in working order.
However, something is preventing the custom variables from working on the inside pages (pages 24 and 25).
Thoughts?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘If Page Code with Custom Variable’ is closed to new replies.