Share this post

Link to post

Share on other sites

Jenny
33

Jenny 33

Did you get the code from PageLines Framework support or PlatformPro support. They each have their own hooks.
To check if "pagelines_inside_top_theloop" is the proper hook, activate the PageLines Action Map plugin on your site and look to see if the hook exists on the home page. (And according to one of the links below, it appears [i]incorrect[/i].)
Next, just guessing here but you probably want a filter, not an action, so you should change that.
Info for learning more about hooks:
http://api.pagelines.com/hooks/
http://www.pagelines.com/wiki/Glossary#Highlight
http://www.pagelines.com/wiki/PageLines_Themes

Share this post

Link to post

Share on other sites

Danny+ 1,327

Danny+ 1,327

Hi tuanma,
If coding isn't your thing, have you tried the Special Recent Post plug-in ? It allows you to use specific options to show only posts from category X and then provides you with a shortcode which you can then add to your Homepage content area.
I think using this plug-in would be the best course of action. I have provided you with a link to the plug-in below.
http://wordpress.org/extend/plugins/special-recent-posts/

Share this post

Link to post

Share on other sites

anthalis
5

anthalis 5

HI Tuan,
This could solve your problem, if you are still looking for a piece of code to exclude categories. Replace the code you pasted in here with the following (in your child theme's functions.php):
[code]
function exclude_category( $query ) {
if ( $query->is_home ) {
$query->set( 'cat', '-1' );
}
}
add_action( 'pre_get_posts', 'exclude_category' );
[/code]
Keep in mind that when using "is_home" you are referring to the blog page. If you have a static page set as Home in Setting>Reading you should replace "is_home" with "is_front_page". Of course, don't forget to replace "-1" with whatever category ID you want to exclude.
Good luck!