Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] display only sticky posts on homepage (http://forum.bytesforall.com/showthread.php?t=23103)

matthieugu Mar 9, 2015 10:08 AM

[SOLVED] display only sticky posts on homepage
 
Hi,

I'm using Montezuma on this site : http://fleury-arthelon.org/site/ And i want to display only the sticky posts on home.php.
I've tried a lot of things like that : <?php if(!is_sticky() && (is_home() || is_front_page()) ) break; ?> in postformat.php but it doesn't work.

Can anybody help me?

Thanks a lot,
Matt

juggledad Mar 9, 2015 01:10 PM

Do not double post! the other post has been removed.

matthieugu Mar 10, 2015 03:43 AM

I appologize for this mistake. I make a wrong manipulation...

juggledad Mar 10, 2015 07:42 AM

when editing any of the virtual templates, in the top right you will see a tab 'Limited PHP Code'. That is the only PHP code that is allowed (due to WP restrictions that are too much to discuss here).

My suggestion would be to create a new page template and add in a dynamic widget area and then find a plugin that could be used to display only stickies.

matthieugu Mar 10, 2015 09:30 AM

Ok, thanks.

I'm going to try

matthieugu Mar 10, 2015 10:04 AM

I found !

I just insert <?php bfa_custom_query('cat=18'); ?> before <?php bfa_loop( 'postformat' ); ?> in my home.php which is a copy of index.php.
I create a new category called "sticky". And it works !

Thanks,

Matt

CrouchingBruin Mar 10, 2015 11:03 AM

One work-around would be to create a category called sticky or featured and assign that category to any posts which you want to be "sticky" (I would probably use featured so the category word looks better on the meta line for your visitors). Then you could use the bfa_custom_query() function to display just those posts. That's kind of the way the TwentyFourteen theme works, you assign a tag like featured to those posts that you want to show up in the Featured Posts grid on the blog page.


All times are GMT -6. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.