• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Featured Custom Post Type Widget

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Featured Custom Post Type Widget

This topic is: not resolved

Tagged: Custom Post Type Featured Post Widget

  • This topic has 7 replies, 2 voices, and was last updated 13 years, 2 months ago by essaysnark.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • May 1, 2013 at 4:58 am #38718
    marjwyatt
    Member

    I would truly appreciate another set of eyes on this problem and hopefully a point in the right direction to solve it.

    I'm customizing the Modern Portfolio theme for a site that uses custom post types with custom post type categories. The Custom Post Type (CPT) taxonomy has been declared as shown below:

    `register_taxonomy( 'portfolio-type', array('portfolio'),
    array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'query_var' => true,
    ));`

    That code is working and properly assigning categories to the custom post types.

    Genesis has a core widget called a Featured Post Widget. The code for that widget is here: http://pastebin.com/0jk5yM4g

    I leveraged that code to allow displays of CPTs as featured posts in the theme's home page portfolio area. That code is here: http://pastebin.com/jdZcffvM

    I referenced this Codex post to make my changes:
    http://codex.wordpress.org/Function_Reference/wp_dropdown_categories

    My customized widget is in the child theme's folder structure so I have not modified Genesis Core code. I've added CSS to the theme to support the display in the same way the core Genesis Widget does and that is working perfectly.

    The widget shows the CPT categories in my customized widget and saves them but it doesn't display the CPT category that has been chosen on the home page which is puzzling me. This development is due for delivery at the end of this week so I'm hoping that someone can offer a solution or tell me why this isn't working as expected. I'm out of ideas.

    I am developing locally so the site isn't online anywhere.


    Virtually Marj Wyatt
    VirtuallyMarj.com | Twitter | Facebook | Google +

    May 1, 2013 at 5:25 pm #38843
    essaysnark
    Participant

    I'm totally dodging your actual question here, but possibly this plugin could do what you need?

    Genesis Featured Widget Amplified

    May 1, 2013 at 9:08 pm #38870
    marjwyatt
    Member

    It might, if I could select anything other than post from the dropdown.  
    I'll look at the plugin code and see if I can reverse engineer it for my purposes.  Thanks.


    Virtually Marj Wyatt
    VirtuallyMarj.com | Twitter | Facebook | Google +

    May 1, 2013 at 9:20 pm #38871
    essaysnark
    Participant

    That plugin supports CPTs and custom taxonomies, It's specifically for Genesis. I don't see why it wouldn't work.

    May 1, 2013 at 9:39 pm #38872
    marjwyatt
    Member

    I had great hopes that it would but, when I loaded the widget, any attempt to chose another post type failed from the dropdown.  You could install it and try for yourself.

    The plugin hasn't been updated in nearly a year.  It could be that a WP update has affected its functionality.


    Virtually Marj Wyatt
    VirtuallyMarj.com | Twitter | Facebook | Google +

    May 1, 2013 at 10:35 pm #38875
    essaysnark
    Participant

    Strange. The plugin works great for me, we have a gazillion CPTs and custom taxonomies and they all display fine in the respective dropdowns in the widget. Maybe whatever is preventing that from working is the same thing that prevented your custom code from working.

    May 1, 2013 at 11:23 pm #38877
    marjwyatt
    Member

    Nope ... not my code.  In the downloaded plugin, this was at the top:
    `
    function __construct() {

    $this->defaults = array(
    'count' => 0,
    'title' => '',
    'post_type' => 'post',
    'page_id' => '',
    'posts_term' => '',
    'exclude_terms' => '',
    'exclude_cat' => '',
    'include_exclude' => '',
    'post_id' => '',
    'posts_num' => 1,
    'posts_offset' => 0,
    'orderby' => '',
    'order' => '',
    'meta_key' => '',
    'show_sticky' => '',
    'paged' => '',
    'show_paged' => '',
    'post_align' => '',
    'show_image' => 0,
    'link_image' => 1,
    'image_position' => 'before-title',
    'image_alignment' => '',
    'image_size' => '',
    'link_image_field' => '',
    'show_gravatar' => 0,
    'gravatar_alignment' => '',
    'gravatar_size' => '',
    'link_gravatar' => 0,
    'show_title' => 0,
    'link_title' => 1,
    'link_title_field' => '',
    'title_limit' => '',
    'title_cutoff' => '…',
    'show_byline' => 0,
    'post_info' => '[post_date] ' . __( 'By', 'gfwa' ) . ' [post_author_posts_link] [post_comments]',
    'show_content' => 'excerpt',
    'show_archive_line' => 0,
    'archive_link' => '',
    'post_meta' => '[post_categories] [post_tags]',
    'content_limit' => '',
    'more_text' => __( '[Read More...]', 'gfwa' ),
    'extra_posts' => '',
    'extra_num' => '',
    'extra_title' => '',
    'extra_format' => 'ul',
    'more_from_category' => '',
    'more_from_category_text' => __( 'More Posts from this Taxonomy', 'gfwa' ),
    'custom_field' => ''
    );

    I changed this line of code
    downloaded code: `'post_type' => 'post',`
    revised code: `'post_type' => '',`

    It now works, with all my customizations in place.

    Thanks for "forcing" me to look at it again. (smile) Now I can move forward.


    Virtually Marj Wyatt
    VirtuallyMarj.com | Twitter | Facebook | Google +

    May 2, 2013 at 9:16 am #38928
    essaysnark
    Participant

    Awesome - glad you figured it out!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble