• 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

add custom sidebar to custom portfolio archive page

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 › add custom sidebar to custom portfolio archive page

This topic is: resolved

Tagged: add sidebar, custom portfolio archive

  • This topic has 5 replies, 2 voices, and was last updated 12 years, 2 months ago by 21pulse123.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 19, 2014 at 12:57 pm #101307
    21pulse123
    Member

    I have created a custom portfolio post type and this is the only portfolio in my site. There is no problem to assign specific sidebar to use as I have add the "sidebar selection" in the post option.

    In the Archive page, i would like to add the "sidebar selection" so i can assign the sidebar created for this page. I am using simple sidebar to create custom sidebar for category/page.

    I am using News Pro theme. Below are the code i used to create the portfolio post type in function.php I have spent few days to find out solution but failed .. I am not knowledgeable on php thus any help or guidance is really appreciated.

    / Create portfolio custom post type */
    add_action( 'init', 'portfolio_post_type' );
    function portfolio_post_type() {
    register_post_type( 'portfolio',
    array(
    'labels' => array(
    'name' => __( 'immigration' ),
    'singular_name' => __( 'immigration' ),
    ),
    'exclude_from_search' => true,
    'has_archive' => true,
    'hierarchical' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'taxonomies' => array( 'post_tag' ),
    'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png',
    'public' => true,
    'rewrite' => array( 'slug' => 'immigration' ),
    'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo', 'genesis-cpt-archives-settings','genesis-simple-sidebars'
    ),
    )
    );
    }

    April 19, 2014 at 10:16 pm #101359
    essaysnark
    Participant

    Let me see if I am following you.

    You've successfully initialized the sidebar, and it's showing up in your Widgets screen? And now you want to use it to display the portfolio CPTs somehow?

    If I've understood you correctly, then I think there are two plugins that may help:

    1. To display the portfolio CPTs, you should be able to use the Genesis Featured Widget Amplified plugin:

    Genesis Featured Widget Amplified

    2. To have that widget operate only on the Archives page, then you can use the Widget Logic plugin

    Widget Logic

    You will want to use a conditional like is_archive()

    https://codex.wordpress.org/Function_Reference/is_archive

    I may have misunderstood part or all of your request though. If so, please write back and explain it again and I'll give it another go.

    April 20, 2014 at 5:14 am #101383
    21pulse123
    Member

    Thanks for your reply.

    Yes i have created a sidebar showing up in the widget screen, but i do not know how to add it to the CPT "archive page". There is no problem to show custom sidebar in "CPT post" becoz there is a sidebar option in post edit. I would like to do the same in the CPT "archive page" as well ... can the widget logic plugin can work for that ?

    April 20, 2014 at 9:14 am #101429
    essaysnark
    Participant

    The suggestions I provided should cover this situation then. Did you try them?

    April 20, 2014 at 4:46 pm #101541
    21pulse123
    Member

    I have tried to add is_archive() but seems not working ...

    April 20, 2014 at 7:27 pm #101563
    21pulse123
    Member

    i have found a fix on this. i downloaded "custom sidebars" and it work on the theme and can create/assign sidebar.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 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