WordPress.org

Ready to get started?Download WordPress

Forums

Superhero
Use Featured Content For Pages (17 posts)

  1. m3fight
    Member
    Posted 1 year ago #

    I have been trying to figure out how to get pages to display as the featured content instead of posts.

    I really like the clean large scrolling images and want to use it as a navigation. I have jetpack installed and can access the featured content as well.

    Any tips on how to get this working?? I would really appreciate it.

  2. m3fight
    Member
    Posted 1 year ago #

    Any information anyone? I've googled and have not been able to find anything.

  3. bekblayton
    Member
    Posted 1 year ago #

    Hi,

    Just playing around with this myself now - you do have to have JetPack installed I know that much!

  4. Featured Content is based on post tags. Since pages do not support tags out of the box, they can not be used with Featured Content.

    To find out more about Featured Content see:
    http://jetpack.me/support/featured-content/

  5. m3fight
    Member
    Posted 1 year ago #

    Wonder if you maybe find a plugin that can add tags to pages you could then use featured content? I'll try and see what I can find.

  6. paulwpxp
    Font hero
    Posted 1 year ago #

    http://wordpress.org/support/topic/tags-for-pages-2

    function tags_for_pages() {
    	register_taxonomy_for_object_type('post_tag', 'page');
    }
    add_action('init', 'tags_for_pages');

    You could try that, and assign tag to pages, then see if the slider pick it up. If it doesn't, it means that Jetpack's featured content also checks for post type is post only.

  7. m3fight
    Member
    Posted 1 year ago #

    Alright, I've gotten the featured content to show the pages but only when I use front page displays latest posts.

    I downloaded http://wordpress.org/plugins/tag-pages/ then edited the plugin'pre_get_posts' hook to change the post_type query parameter to 'any'.

    I cant seem to activate the featured content on static page home. Optimally I would like the home page to just display the header. Looks like its the next step to figure out. Any other tips on that would be great. Thanks for the help too paulwpxp, if I cant get it to work this route I'm going to try yours out.

  8. paulwpxp
    Font hero
    Posted 1 year ago #

    That plugin does the same thing with the addition of getting the page post type into the list of post in tag archive too.

    ..then edited the plugin 'pre_get_posts' hook to change the post_type query parameter to 'any'.

    So I'm not sure why and how you did the above for.

    ..cant seem to activate the featured content on static page home.

    If you look at header.php you would see that the slider will appear only when it is_front_page(). This returns true when on static front page, or blog home page.

  9. m3fight
    Member
    Posted 1 year ago #

    Alright, any way to edit the header.php to display on static?

  10. paulwpxp
    Font hero
    Posted 1 year ago #

    When you say "static", what do you mean ?

  11. m3fight
    Member
    Posted 1 year ago #

    When you go into customize theme it has the option to choose from the following options:

    Front page displays
    Your latest posts
    A static page

    When I choose "your latest posts" I can get the pages to show in the featured content section but it displays the blog section.

    When I choose "a static page" and use the home page I can no longer get the featured image slider to stay.

    What I would like optimally to happen is to display those pages in the slider on the home page. But I can only get it to work showing the latest posts.

  12. paulwpxp
    Font hero
    Posted 1 year ago #

    You have that edited plugin on for that result, or it happened without plugin ?

    When you say "home page", you mean a regular page that you created under "page" and named it "Home", am I right ?

  13. m3fight
    Member
    Posted 1 year ago #

    Yes, home is a static page I created. I can only get the the slider to work when I set to latest posts.

  14. paulwpxp
    Font hero
    Posted 1 year ago #

    This is from theme's header.php
    http://themes.svn.wordpress.org/superhero/1.1/header.php

    <?php if ( is_front_page() ) : ?>
    	<?php get_template_part( 'slider' ); ?>
    <?php endif; ?>

    And here is from is_front_page() documentaion page.
    http://codex.wordpress.org/Function_Reference/is_front_page

    It returns TRUE when the main blog page is being displayed and the Settings->Reading->Front page displays is set to "Your latest posts",

    OR

    when is set to "A static page" and the "Front Page" value is the current Page being displayed.

  15. paulwpxp
    Font hero
    Posted 1 year ago #

    So, under Settings->Reading->Front page displays, when a regular page named "Home" (or whatever name) is set to be a static front page of the site, that page will be used as front home page AND will have a slider.

  16. m3fight
    Member
    Posted 1 year ago #

    I've tried that and can't seem to get this damn slider to work on static front page.

  17. doomwaxer
    Member
    Posted 2 months ago #

    There is a another way of doing it, but it's very hacky.

    If you give both the post and page the same permalink, the post will populate the featured content area, but the page will be displayed when clicked upon.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic