WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] how to show recent Blog post in a static home page (11 posts)

  1. yavarkhan
    Member
    Posted 6 months ago #

    i would like to show 5 recent blog post in a horizontal way in the static home page ! pls help

  2. yavarkhan
    Member
    Posted 6 months ago #

    i want my customizr home page to show recent blog post with pictures

  3. rdellconsulting
    Member
    Posted 6 months ago #

    Go to Customiz'it! > Front Page
    Front Page can point to either a Static Page or your Latest Posts. So there are a few combinations that can be set (Home & Blog refer to blank Pages):
    1) Front page displays: Don't show any posts or page
    2) Front page displays: your latest posts =Displays posts
    3) Front page displays: A static Page
    Posts page: --Select--
    Front page: --Select-- =Displays posts
    4) Front page displays: A static Page
    Posts page: --Select--
    Front page: Home =Displays static page
    5) Front page displays: A static Page
    Posts page: Blog
    Front page: --Select-- =Displays posts
    6) Front page displays: A static Page
    Posts page: Blog
    Front page: Home =Displays static page

    Does Option 2 work for you?

  4. yavarkhan
    Member
    Posted 6 months ago #

    sir it didnt work!
    actually
    i want my post page = blog page
    Front page displays =static page
    front page = home
    and im making a eCommerce website so i want featured product on the home page and below that 5 recent blog post with pictures in a horizontal way
    waitng for ur reply

  5. yavarkhan
    Member
    Posted 6 months ago #

    some 1 suggested me

    consider to create a page template based on the code of page.php of your theme http://codex.wordpress.org/Page_Templates and integrate a custom loop http://codex.wordpress.org/The_Loop where you want the posts to show, using a custom query http://codex.wordpress.org/Class_Reference/WP_Query

    but im new to this could u help me out

  6. yavarkhan
    Member
    Posted 6 months ago #

    @rdellconsulting i made a wp_query in function.php but i would like it to display 5 recent post with thumbnails

    /*** Custom Loop ***/
    function demo_loop() {
      $args = array(
    		'cat' => 0,
    		'posts_per_page' => 2
    	);
    
    	$demo_posts = new WP_Query($args);
    
    	if ( $demo_posts->have_posts() ) {
    		while( $demo_posts->have_posts() ) {
    			$demo_posts->the_post();
    
    			$output .= '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>';
    		}
    	}
    
    	return $output;
    }
    
    add_shortcode( 'demo_custom_loop', 'demo_loop' );
  7. rdellconsulting
    Member
    Posted 6 months ago #

    Can we see a link to your site?

  8. yavarkhan
    Member
    Posted 6 months ago #

    actually sir im making it in a localhost!

  9. yavarkhan
    Member
    Posted 6 months ago #

    sir could u help me with a code snippet to declare it in function.php so i could show my recent blog post

  10. ElectricFeet
    Member
    Posted 6 months ago #

  11. yavarkhan
    Member
    Posted 6 months ago #

    thx

Reply

You must log in to post.

About this Theme

About this Topic