WordPress.org

Ready to get started?Download WordPress

Forums

Featured Category Posts on a Page (1 post)

  1. jr991
    Member
    Posted 3 years ago #

    Hello, I would really appreciate some help customizing a theme that I am using. The theme I am using has the option to activate "Featured Category Posts" on single posts. This displays in the sidebar. I am trying to get this to work on a particular page. This is complicated for me because I don't know PHP very well.

    I have created a new Page template which calls a secondary sidebar php file. I got this part to work. The problem I am facing now is with coding the sidebar PHP file.

    Here's the part of the code from the current sidebar.php file I want in my new sidebar php file.

    <!-- FEATURED CATEGORIES BOX START -->
    <?php $featured_category_active = get_theme_option('featured_category_activate'); if(($featured_category_active == '') || ($featured_category_active == 'No')) { ?>
    <?php { /* nothing */ } ?>
    <?php } else { ?>
    <?php if(is_home()) { ?>
    <?php include (TEMPLATEPATH . '/featured-category.php'); ?>
    <?php } ?>
    <?php } ?>
    <!-- FEATURED CATEGORIES BOX END -->

    Question #1: In my theme options I have the setting set to display posts from a selected category, which then makes this a site wide configuration. How can I re-write this code to display the featured posts from a specific category.

    I'm certain I also need to do something with the Featured-Category.php file as well. Can I post the code for that file here for review??

    I only want these changes to effect the new page that I am working on so that's why I have created a new page template and a new side bar file.

    Again, I would really appreciate someone taking the time to help me with this.

Topic Closed

This topic has been closed to new replies.

About this Topic