Help Creating Sidebar Using CPTs

This topic contains 7 replies, has 2 voices, and was last updated by  Paolo 8 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #58207

    explorer
    Expired Member
    Post count: 172

    My programmers have created an awesome accordion-style sidebar using our three CPTs, as well as the CPT categories.

    However, when a listing page is clicked, the sidebar shuts because it doesn’t recognize the listing as being part of the CPT or CPT category.

    HELP!

    P.S. I will post a screenshot below so I can mark it as private.

    #58208

    explorer
    Expired Member
    Post count: 172
    This reply has been marked as private.
    #58283

    Paolo
    Site Admin
    Post count: 31206
    This reply has been marked as private.
    #58321

    explorer
    Expired Member
    Post count: 172

    Paolo,

    I understand that. I am asking if you know of a way to associate the listing pages with the CPT or CPT category for this purpose?

    #58322

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    the listing page IS associated with both the CPT and it’s category.

    They need to write the code to check when on the listing page, which CPT and taxonomy it is used for that listing.

    https://codex.wordpress.org/Function_Reference/wp_get_object_terms
    https://codex.wordpress.org/Function_Reference/get_post_type

    Thanks

    #58323

    explorer
    Expired Member
    Post count: 172

    As always, thanks so much Paolo. I will pass this on to them.

    #58353

    explorer
    Expired Member
    Post count: 172

    Paolo,

    One more thing… is it possible to show a different sidebar menu/widgets for each CPT?

    I see several widget areas (i.e. GD Listing Left Sidebar, etc.), but none specific to each CPT.

    #58425

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    all CPT share the same template (listings page) and there are limited sidebars for it.

    If you want to add specific widget for each CPT, you could use https://wordpress.org/plugins/widget-logic/.

    For exmaple for Places you’d use

    ( 'gd_place' == get_post_type() )

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket