Viewing 4 replies - 1 through 4 (of 4 total)
  • different approach from your posted link, but should work.
    the code goes into functions.php of a child theme.

    function page_content_on_posts_page() {
    if( get_option( 'page_for_posts' ) && is_home() ) {
    global $wp_query;
    if( !is_paged() && $wp_query->current_post == 0 ) { ?>
    <article id="post-<?php echo get_option( 'page_for_posts' ); ?>" class="<?php echo implode(  ', ', get_post_class( 'posts-page-content', get_option( 'page_for_posts' ) ) ); ?>">
     
    <div class="entry-content">
    <?php
    echo apply_filters( 'the_content', get_post( get_option( 'page_for_posts' ) )->post_content );
    ?>
    </div><!-- .entry-content -->
    </article><!-- #post-## -->
    <?php }
    }
    }
     
    add_action( 'the_post', 'page_content_on_posts_page' );

    the html in the code is for Twenty Fourteen and might need to be adapted to show proper formatting in Twenty Fifteen.

    Thread Starter mslast

    (@mslast)

    Fantastic! That gives me the post content… thank you so much! Any idea how to get the title too? Thank you again for your response!

    for example, code including the page title:

    function page_content_on_posts_page() {
    if( get_option( 'page_for_posts' ) && is_home() ) {
    global $wp_query;
    if( !is_paged() && $wp_query->current_post == 0 ) { ?>
    <article id="post-<?php echo get_option( 'page_for_posts' ); ?>" class="<?php echo implode(  ', ', get_post_class( 'posts-page-content', get_option( 'page_for_posts' ) ) ); ?>">
    
    <header class="entry-header">
    		<h1 class="entry-title">
    <?php
    echo get_the_title( get_option( 'page_for_posts' ) );
    ?>
    		</h1>
    </header><!-- .entry-header -->
    	
    <div class="entry-content">
    <?php
    echo apply_filters( 'the_content', get_post( get_option( 'page_for_posts' ) )->post_content );
    ?>
    </div><!-- .entry-content -->
    </article><!-- #post-## -->
    <?php }
    }
    }
     
    add_action( 'the_post', 'page_content_on_posts_page' );
    Thread Starter mslast

    (@mslast)

    Thank you very much Michael!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add title/intro to posts page’ is closed to new replies.