How to get "After post" to be displayed on home page posts?

Community Forums Forums Design Tips and Tricks How to get "After post" to be displayed on home page posts?

This topic is: not resolved

This topic contains 12 replies, has 3 voices, and was last updated by  Fabio 2 years, 4 months ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #52699


    Hi there,
    if you see on the home page of my site
    [warning: this is a porn/adult website and if you click you’ll see porn images]

    Posts on the home page are displayed in full. Same thing happens for the subsequent pages. You can always see three full posts.

    I would like to get the “after post” widget displayed after each photo on the home page and subsequent pages.
    At the moment the “after post” widget only displays on the post page itself.

    How can I get the “after post” widget displayed after each photo on home page and subsequent pages?
    Thanks a lot in advance for the help!!!




    What code are you using?



    Hi Brad!
    thanks a lot to come help!

    To be honest I’m not sure I understood your question…
    Do you mean code for the “after post”?

    If so, I’m using the afterpost widget that comes with the “eleven40″ theme.

    And about getting pictures displayed on every page in full, I have changed home.php to home1.php according to the advice I’ve been given on this forum.

    I hope this helps.
    Please let me know if you need any other info!



    Nile Flores

    The correct template hierarchy is front-page.php, not home.php. Otto (aka Samuel Woods) and I have discussed this in depth at WordCamps and instead of is_home, use is_front_page

    I help people rock out their sites! –




    sorry I don’t understand how your reply helps me getting the after post displayed…


    Nile Flores

    Rename your home.php to front-page.php

    Instead of using the is_home in your functions to display after post, using is_front_page

    For example, I am using the front-page.php and want my newsletter (which is a widget area) to display above my content wrap area and ONLY on my front page. (This code is from the functions.php)

    /** Add newsletter section after header */
    add_action( 'genesis_before_content_sidebar_wrap', 'bsg_newsletter' );
    function bsg_newsletter() {
       if ( ! is_front_page() )
       genesis_widget_area( 'newsletter', array(
           'before' => '<div class="newsletter widget-area">',
       ) );

    genesis_after_post_content would be the hook.

    (Note: change the bsg to the theme name you are using)

    I help people rock out their sites! –

    • This reply was modified 2 years, 4 months ago by  Nile Flores.
    • This reply was modified 2 years, 4 months ago by  Nile Flores.


    Hi Nile,
    is there any simpler way?

    That sounds super complicated!
    Also, if I change home.php to frontpage.php I’m afraid I’ll lose the ability to have full pictures displayed in subsequent pages of the home page.

    Also, the after post is not going to be a newsletter but some text with call to action button.

    @Brad? Do you have any easier solution?

    Thanks for your help!



    Hi Fabio

    I tested this code and it works for both home or front page:

    It uses the same styling as your after single post widget so change the class if you want to change this.

    It creates a separate widget so you can display a CTA after all home/front page excerpts and featured images.

    Here’s an example of a CTA you can use in a text widget:

    &lt;div class=&quot;three-fourths first&quot;&gt;Here&#8217;s a great place to place a special offer or to write something specific that you want your visitors to read.&lt;/div&gt;
    &lt;div class=&quot;one-fourth&quot;&gt;<a href="&quot;#&quot;">Contact Us Today</a>&lt;/div&gt;



    Hi Brad, thanks a lot.

    I’m not sure how I need to use it though.
    So basically I need to paste the 1st code at the bottom of my home.php?
    And what with the second? Where do I place it?




    No. Paste it at the end of your child themes functions.php file.

    Copy the code from the Gist link and then the view raw link on Github.

    The second code is HTML and goes into a new text widget on your widgets page.

    I suggest you install WordPress locally with a copy of your theme so you can test code when customizing your site yourself.



    Brad Dalton you rock man!
    Thanks so much!

    Just last question:
    what do you mean by: install wordpress “locally”?
    What does locally mean?

    I usually test everything on my test site first, but maybe this “locally” thing can be even better?

    Thanks a lot!!!!!
    You’re the best.




    A live test site is ok

    Or you could use for windows or MAMP for Mac and install WordPress on your local computer for testing.



    Thanks a lot!

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.