Add Static Text above Blog Post Page

How would I modify one of the .php files to be able to show static text at the top of my blog posts’ page.

I saw this article here, that suggests I add this code below… but I’m not sure that will work with Shapely, nor do I know which .php file to add this to.

I mostly want to show the Page’s “Title” and if possible a brief intro/paragraph above the posts. As you probably are aware, when we select a “Page” to be the 'blog-post page" for all posts, this page’s content no longer appears. I’d like to adjust this, and I think I need to do that in one of the theme files.

Please advise!

if ( ‘page’ == get_option(‘show_on_front’) && get_option(‘page_for_posts’) && is_home() ) : the_post();
$page_for_posts_id = get_option(‘page_for_posts’);
<div id=“post-<?php the_ID(); ?>” class=“page”>
<div class=“entry-content”>
<?php the_content(); ?>
<?php edit_post_link(‘Edit’, ‘’, ‘’, $page_for_posts_id); ?>

Hello there,

I hope you are doing well today.

If you are going to do this please use the following plugin to create and activate a child theme to contain the changes made to the theme:

In order to add the code, go to Appearance >Editor > Single page and add it there.

Best Regards,

Thank you for your help!

I’m on the page.php (via your instructions: Appearance >Editor > Single page). Where would I insert the code above? Do I just put it below “get_footer();”, or does it need to be nested in “get_header():”. I’ve copied the existing page.php text below, WITHOUT adding any modified code to it.

Thank you again for your help. I really love this theme, and would love to get this working :slight_smile:


  • The template for displaying all pages.
  • This is the template that displays all pages by default.
  • Please note that this is the WordPress construct of pages
  • and that other ‘pages’ on your WordPress site may use a
  • different template.
  • @link
  • @package Shapely

get_header(); ?>
<?php $layout_class = shapely_get_layout_class(); ?>
<div class=“row”>
if ( ‘sidebar-left’ == $layout_class ) :
<div id=“primary” class=“col-md-8 mb-xs-24 <?php echo esc_attr( $layout_class ); ?>”>
while ( have_posts() ) :

																get_template_part( 'template-parts/content', 'page' );

																// If comments are open or we have at least one comment, load up the comment template.
																if ( comments_open() || get_comments_number() ) :

		endwhile; // End of the loop.
	&lt;/div&gt;&lt;!-- #primary --&gt;
	if ( 'sidebar-right' == $layout_class ) :