Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to get "After post" to be displayed on home page posts?
- This topic has 12 replies, 3 voices, and was last updated 10 years, 8 months ago by Fabio.
-
AuthorPosts
-
July 26, 2013 at 4:27 pm #52699FabioParticipant
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!!!F.
July 26, 2013 at 9:08 pm #52720Brad DaltonParticipantJuly 27, 2013 at 3:08 am #52750FabioParticipantHi 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
July 27, 2013 at 5:17 am #52754Nile FloresMemberThe 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
July 27, 2013 at 5:50 am #52765FabioParticipanthi,
...
sorry I don't understand how your reply helps me getting the after post displayed...July 27, 2013 at 6:05 am #52767Nile FloresMemberRename 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
July 27, 2013 at 6:49 am #52773FabioParticipantHi 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.July 27, 2013 at 6:06 pm #52882Brad DaltonParticipantHi 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:
<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"><a href=""#"">Contact Us Today</a></div>
July 28, 2013 at 4:17 am #52927FabioParticipantHi 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!
FabioJuly 28, 2013 at 4:46 am #52928Brad DaltonParticipantNo. 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.
July 28, 2013 at 5:46 am #52929FabioParticipantBrad 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
July 28, 2013 at 5:55 am #52930Brad DaltonParticipantA 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.
July 28, 2013 at 6:18 am #52931FabioParticipantThanks a lot!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.