• Resolved izzyiz

    (@izzyiz)


    On home page in the News Section how can I get some of the post to show up along with title & date? Ive changed it to Masonry for 4 columns (4 posts) but none of the post content is showing just title and date.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @izzyiz,

    It is possible to display some of your post’s content on the home page, however, this will require some comfort and willingness to experiment with HTML/basic PHP.

    The first step is for you to set up a child theme.

    In case you’re not familiar with child themes, the following guides provide a good introduction, including steps to get set up:

    After you have completed that step, copy the parent’s content-news.php file to your child theme’s directory and then open it in your favourite text/code editor.

    Locate the following code in that file:

    <header class="entry-header">
    	<h1 class="entry-title">
    		<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
    	</h1>
    	<?php harmonic_posted_on(); ?>
    </header><!-- .entry-header -->

    The above portion of the code outputs a post’s title and date to your site’s home page.

    We need to add code to output the post’s excerpt directly beneath that and can use WordPress’ built in the_excerpt function:

    <div class="entry-summary">
    	<?php the_excerpt(); ?>
    </div><!-- .entry-summary -->

    Save your changes after you’ve inserted the above code.

    Your summary may need to by styled with CSS in order to line up nicely with the other content in the News Section.

    If you’d like help with that then please share a link to the site that you’re customising in order to allow me to inspect your site’s code directly. (The links in your profile are both currently leading to “coming soon” landing pages.)

    Thanks!

    Thread Starter izzyiz

    (@izzyiz)

    Thank You Siobhan,

    Working! I do need help with line up. You will notice I used css to create a masonry look for three columns. Would like to get all post in one vertical line up under each title.
    links in profile are correct….turning off “coming soon” for your review.

    IZ

    Glad that worked!

    You can get the post’s excerpt to display in one column beneath the title by adding the following snippet to the child theme’s style.css file:

    #news-section .entry-header {
        width: 100%;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘See post content on FP not just title and date’ is closed to new replies.