In developing a site, I successfully added a block of text in the header which calls up a post to present the client’s name, phone and email. It worked fine on my MAMP setup. All Pages showed the custom block in the header.
In setting the site up on my client’s hosting, my custom block only shows up if I view the Post that contains this custom information. All the Pages do not show this block.
The site is setup up with pretty permalinks on the client’s hosting. My MAMP setup uses iD numbers. Aren’t I able to use id numbers in my post callup even though the site uses pretty permalinks?
And here is the callup in my header.php file that calls up the post:
<?php $captext_q = new WP_Query( 'p=1' ); // The Loop if ( $captext_q->have_posts() ) : while ( $captext_q->have_posts() ) : $captext_q->the_post(); ?> <?php the_content(); ?> <?php endwhile; endif; wp_reset_postdata(); ?>
My post is the “Hello World” default post, edited, so it’s ID 1.
And ideas why my custom block isn’t showing up on Pages? (And I’m prepare to have missed the obvious… 🙂 )
- The topic ‘Custom block in header works on post page but not on "page" page’ is closed to new replies.