How To Add 3 latest post summaries to a section on Home Page?

rajsidhux
24 Posts
rajsidhux posted this 25 October 2016

Hi,

I have a blog home page where I want to add a section that displays a summary of my last 3 blog posts.

I want it to look like the "From The Blog" section on this home page.

Can this be done in Themler?

Thanks

Hi, I have a blog home page where I want to add a section that displays a summary of my last 3 blog posts. I want it to look like the "From The Blog" section [on this home page.][1] Can this be done in Themler? Thanks [1]: http://backlinko.com/
Vote to pay developers attention to this features or issue.
8 Comments
Order By: Standard | Newest
Stagger Lee
1818 Posts
Stagger Lee posted this 25 October 2016

Next time write what CMS do you use.

For Post limit:

function limit_posts_on_homepage( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
        $query->set( 'posts_per_page', 3 );
    }
}
add_action( 'pre_get_posts', 'limit_posts_on_homepage' );

To choose from what Category:

function my_home_category( $query ) {
 if ( $query->is_home() && $query->is_main_query() ) {
 $query->set( 'cat', '11');
 }
}
add_action( 'pre_get_posts', 'my_home_category' );

Or multiple:

$query->set( 'cat', '11', '14');

Next time write what CMS do you use. **For Post limit:** function limit_posts_on_homepage( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'posts_per_page', 3 ); } } add_action( 'pre_get_posts', 'limit_posts_on_homepage' ); **To choose from what Category:** function my_home_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( 'cat', '11'); } } add_action( 'pre_get_posts', 'my_home_category' ); **Or multiple:** $query->set( 'cat', '11', '14');
rajsidhux
24 Posts
rajsidhux posted this 25 October 2016

Thanks for your reply Stagger Lee.

Sorry, I'm using Wordpress.

So where do I add all of this code?

Thanks for your reply Stagger Lee. Sorry, I'm using Wordpress. So where do I add all of this code?
shaulhadar
447 Posts
shaulhadar posted this 25 October 2016

Probably in cms control.....

Probably in cms control.....
Stagger Lee
1818 Posts
Stagger Lee posted this 25 October 2016

In custom plugin or Home tab - Settings - CMS Code.

In custom plugin or Home tab - Settings - CMS Code.
rajsidhux
24 Posts
rajsidhux posted this 25 October 2016

Thanks for your reply again, thing is I'm not a coder so I don't understand which part of the code I need to add to the CMS Code editor.

Could you send any screen shots of what you mean?

Many thanks for your help so far :-)

Thanks for your reply again, thing is I'm not a coder so I don't understand which part of the code I need to add to the CMS Code editor. Could you send any screen shots of what you mean? Many thanks for your help so far :-)
Stagger Lee
1818 Posts
Stagger Lee posted this 25 October 2016

They are codes for Post limit and from what Category you want to show Posts. Say 3 Posts from category named Blog, Category ID = 145. If you want to show all latest Posts skip Category snippet.

Rest (layout & design) you make visually with Themler. Cannot explain more, it is in Documentation and matter of practicing.

They are codes for Post limit and from what Category you want to show Posts. Say 3 Posts from category named Blog, Category ID = 145. If you want to show all latest Posts skip Category snippet. Rest (layout & design) you make visually with Themler. Cannot explain more, it is in Documentation and matter of practicing.
rajsidhux
24 Posts
rajsidhux posted this 02 November 2016

Is there a way to insert the last 3 post excerpts within Themler without using code?

Is there a way to insert the last 3 post excerpts within Themler without using code?
Support Team
Support Team posted this 03 November 2016

Hi,

Unfortunately there is no possibility to do it without using the custom code.

Sincerely,
Hella

Hi, Unfortunately there is no possibility to do it without using the custom code. Sincerely, Hella
You must log in or register to leave comments