Jump to content
Sign in to follow this  
kellid

How do I showcase the latest posts (2 different categories) on the home page?

Recommended Posts

kellid

Hi again, You guys have helped me tremendously divide my posts into to different pages using categories. My question now is... Is there a way to have the latest posts (one from each category) showing on the home page (with image) in a way that looks like 2 soapboxes? I don't want them on the sidebar but in the main area. I was thinking a sticky plug in, specifically "post-per-cat" but they ask to put this code <?php do_action("ppc"); ?> in the index.php file but there is no place to put it. Would anyone know a way to have the latest posts on the home page side by side in the main content area? Thanks You :) Kelli

Share this post


Link to post
Share on other sites
kastelic
You can put your code or any code on the homepage via hooks. Watch the vid on hooks here: http://www.pagelines.com/docs/base-child-theme The hook you will want to use is probably paglines_before_maincontent or pagelines_after_maincontent. You will also want to wrap you code in an 'if' statement to make it appear on the home page only. Here's an example (this will go in platformbase/functions.php): [code] add_action('pagelines_before_maincontent','custom_loop'); function custom_loop(){ if( is_home() ){ //put your custom loop here. } } [/code]

Share this post


Link to post
Share on other sites
kellid
I can't thank you enough for leading me inthe right direction Kastelic. A bit more technical than I've done as of yet but I'm going to give it a try. Much appreciated!!!

Share this post


Link to post
Share on other sites
kellid
2 questions...This is from my functions php file. I want to add a second loop and keep the loop that allows the social icons on the branding section. 1st question is do I append below each line or make a separate section below. // HOOKS EXAMPLE --------// // Below is an example of how you would add a social media icon to the icons in header (branding section) // We have placed a hook at the end of the icon set specifically add new icons without modifying code or having to worry about your edits // getting thrown out during the upgrade process. The way to use hooks goes a little like this: // add_action('hook_name','function name'); // ---> uncomment to load //add_action('pagelines_branding_icons_end', 'add_icons_to_branding'); // ADD SECOND ACTION // function name function add_icons_to_branding(){ // This hook adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css // and is the image from the CSS is placed in the images folder ?> array(48,17), 'posts_per_page' => 2, 'orderby' => 'title', 'order' => 'DESC' ) ); } } Please help!!! Thanks again.

Share this post


Link to post
Share on other sites
Rob
I believe adding a second loop would simply copy the loop's content and display it twice.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kellid
No! Thanks for asking Catrina!! I wanted to accept Kastelic's answer but couldn't go back to change. I'm good now :) Thanks again!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×