Let’s say you’ve setup three beautiful featured pages on your home page. Now you might want to display this block of featured pages in another post or page of your website.
This snippet will show you how to do it.
Move your home featured pages in another page / post
In the following example, I move featured page from home to page with id #47.
add_filter ( 'tc_show_fp' , 'move_fp_from_home_to_somewhere'); function move_fp_from_home_to_somewhere () { //this checks if there are featured pages defined in the theme options in database and if your conditional tag returns a true value return 0 != esc_attr( tc__f( '__get_option' , 'tc_show_featured_pages' ) ) && is_page( 47 ); }
Duplicate your home featured pages in other pages/posts
In this example, I duplicate the featured pages to three different pages with ids #47, # 48, #49.
add_filter ( 'tc_show_fp' , 'my_fp_boolean_condition'); function my_fp_boolean_condition ($show_fp) { //this checks if there are featured pages defined in the theme options in database and if your conditional tag returns a true value return 0 != esc_attr( tc__f( '__get_option' , 'tc_show_featured_pages' ) && is_page( array (47, 48, 49 ) ); }
Useful resources :
38 thoughts on “Featuring pages on another page / post than home”
Is there a way to add this with a [shortcode] – rather than editing a file?
Hello Nicolas,
Thank you for the above code snippet for featured pages.
My goal is to have a couple of my internal sub pages (not all of them) to look like the front page with the feature page links.
So, I tried the code above for duplicating the featured page in other pages.
But the featured page links in my Front Page are gone now and appear in the sub pages where I want them. How to get the links back in my Front page?
Any help is greatly appreciated. I’m using Customizr Pro, latest version.
Thanks
Hi Viji,
The developer team handles support for Customizr-Pro at http://presscustomizr.com/support/. Please post your query there with a link to your site.
Hi there,
I added the code under “Duplicate your home featured pages in other pages/posts” to my child theme’s functions.php , and this broke my website. Does this have anything to do with the customizr theme being updated?
Asool
Hello Asool,
just re-tested this snippet with the latest Customizr (3.4.8) and it works fine.
You might have done some syntax error..?
Take a look at this doc on how to debug your wp:
http://doc.presscustomizr.com/customizr/diagnosing-problems-customizr/
Hope this helps.
I have the same problem, did you find a solution yet? Maybe you can help me out?
Hi Tine!
our developer team tries to handle technical requests for the Customizr free theme in the support forum, would you mind asking your question there ?
https://wordpress.org/support/theme/customizr
Thanks 🙂
Hi,
I have been looking over the responses on this forum and tried most of them but I cannot seem to find a solution to my problem. I would like to have featured pages appear on another page, I want the featured pages to be different than the ones that are on my home page. I managed to get the featured page bubbles on another page, but they no longer appeared on my home page and I was not able to change which pages appeared. I know this topic has been discussed before but I really cannot figure this out. I’m a total newbie at Wordpress by the way.
Thank you!
Can`t wait for this! It is awesome that you make such a great suppost!
Dear Nicolas,
We would like to add more featured pages to different pages and this is great – we can use code above. However, we would like to use different images, links and titles for different pages. Basically we need FP design on another page but with all different info. How do we do this?
Thanks,
Moh
Hi this feature is currently under active development and will be ready soon in the Featured Pages plugin and the Customizr Pro.
Cheers
Hi Nicholas,
I don’t suppose there’s an ETA for these new features by chance?
By mid february 2015 !
🙂
Is this out yet?
Dear Nicolas,
That’s great news.
I am getting this error on GTMetrix & Pingdom:
The following requests are returning 404/410 responses. Either fix the broken links, or remove the references to the non-existent resources.
http://relief-from-pain.co.uk/holder.js/270×250
What should I do to correct it please?
Thanks
Guy
Hi, I just checked your website. I don’t see this message anymore. There are other 404 errors now related to the static url where you hot your resources : http://static.relief-from-pain.co.uk/
Best
Hi Nicolas,
You gave me some code to add FPs to all pages and it works great – as always!
how do I exclude the cart and checkout pages from displaying FPs please?
Thanks
Guy
Dear Nicolas,
Many thanks for responding so quickly.
I’ve tried this code and the home page seems to work but the FPs don’t appear on any other pages. In customise theme I’ve tried to set the FPs to be in other places and if I set ‘Before Footer’ the FPs don’t appear.
Any ideas what is wrong?
One other question I’d like the FPs to be all the same height irrespective of how much text they have in them, how do I change the code to do this please?
Many thanks
Guy
Hello Nicolas,
I’ve bought your plugin for my Customizr theme and thought that it would be easy to duplicate my home page featured pages to all my sites pages and product pages (i’m using Woocommerce) but whatever I try to do give the wrong result.
First I tried using the custom location and added the to my theme header and that was fine for the home page but when I put this code into my functions.php:
add_filter ( ‘tc_show_fp’ , ‘move_fp_from_home_to_somewhere’);
function move_fp_from_home_to_somewhere () {
//this checks if there are featured pages defined in the theme options in database and if your conditional tag returns a true value
return 0 != esc_attr( tc__f( ‘__get_option’ , ‘tc_show_featured_pages’ ) )
&& is_page( 47 );
}
The featured pages appear before the page text, which is obvious really as they appear before an text on the home page!
So I’d like to have the featured pages appear just before the footer (I’ve had no luck getting this to work for me).
Can you help please?
Thanks
Guy
Hi Guy,
Here’s the code you need to :
1) display featured pages in a custom location on home
2) display the same set of FP in another custom location on other pages
Hope this helps!
Dear Nicolas,
I’m still unable to make this work, do you have any suggestions please?
Thanks
Guy
Hello Nicolas,
I’ve found the problem with my code not working. It was my fault and your code works fine. What I did do is remove the code to re-position the Featured Pages (Starts here: add_action( ‘wp_head’ , ‘change_fp_location’, 100 );) and this is excellent as I can use the Customize option in my child them to manage the Featured Pages which now appear on all pages.
It would be very helpful for me in a future version to be able to have maybe 3 or 4 sets of Featured Pages that I can display on different types of pages e.g. pages, posts, products (I use Woocommerce), home page – I hope you can do this soon.
Thanks
Guy
Hi Guy, you have just described what I am actually working on at this very moment !
Thanks
Dear Nicolas,
Excellent, how long before you’ll have it done?
This will should be ready next month.
Hi
Thank you for the above code. I like to duplicate the featured pages to 404 not found page. At the moment there is quotation on top of the 404 page from George Orwell and then the search box. Ideally I would like to add the featured pages below the search box.
Thank you for your help.
Best regards
Hi Farz,
You can modify the snippet this way to display your featured pages in the 404 page.
Then, to move the FP below the search box, you’ll need to modify their initial hook like in the following example.
I hope this will help you achieve what you need!
Thank you Nicolas!
Hey,
First of all, thanks a lot for this great theme and the code snippets, they’ve helped me a great deal to get started with wordpress!
I see that these snippets move or duplicate the featured pades, but what if I want to feature different pages on yet a different page?
Is it also possible?
Hi Steve, you can change the featured pages id with the filter named : tc_fp_id and defined as follow in the core code :
Hope this will help you.
Thanks for this code. When I used it, the images above the Featured Pages are not showing. Any ideas?
Hi,
so far i have dublicated the featured pages to another page, which worked fine and moreover changed the linked content but is there a way to also change the featured image, text and button to the newly linked page? Right now the images, text and button refer to the old link but clicking on them leads to the new page.
I already found the “different texts on the Featured Pages Buttons” snipped, but that one is changing the text of the buttons generally and not only the one of the dublication .
I would be very thankful for some help.
Regards
What file are you editing here Nicolas?
Hi Charlie : functions.php
Many thanks.
Hi, i would like to put different page links than the homepage links on the others pages.
I don’t know at all how to do it, is it even possible ?
Hi Julien,
As described in this snippet, you can customize your featured pages links with this code :
Now if you need to customize the links of featured pages on other pages than home, just add a conditional tag in the callback function (my_custom_fp_link() ). For example :
Hope this will help
Thanks ! You’re so helpful and fast ! 🙂