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 1 year, 1 month ago.

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

    Fabio
    Participant
    Post count: 178

    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]

    http://porn.letstalksex.net

    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!!!

    F.

    #52720

    braddalton
    Participant
    Post count: 9412

    What code are you using?


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #52750

    Fabio
    Participant
    Post count: 178

    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!

    Thanks

    #52754

    Nile Flores
    Participant
    Post count: 29

    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! – Blondish.net

    #52765

    Fabio
    Participant
    Post count: 178

    hi,

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

    #52767

    Nile Flores
    Participant
    Post count: 29

    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() )
           return;
    
       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! – Blondish.net

    • This reply was modified 1 year, 1 month ago by  Nile Flores.
    • This reply was modified 1 year, 1 month ago by  Nile Flores.
    #52773

    Fabio
    Participant
    Post count: 178

    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!
    F.

    #52882

    braddalton
    Participant
    Post count: 9412

    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:
    [html]
    <div class="three-fourths first">Here’s a great place to place a special offer or to write something specific that you want your visitors to read.</div>

    <div class="one-fourth">Contact Us Today</div>
    [/html]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #52927

    Fabio
    Participant
    Post count: 178

    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?

    Thanks!
    Fabio

    #52928

    braddalton
    Participant
    Post count: 9412

    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.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #52929

    Fabio
    Participant
    Post count: 178

    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 exclusiveskills.com first, but maybe this “locally” thing can be even better?

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

    Fabio

    #52930

    braddalton
    Participant
    Post count: 9412

    A live test site is ok

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


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #52931

    Fabio
    Participant
    Post count: 178

    Thanks a lot!

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

You must be logged in to reply to this topic.