• 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

Custom Post Types by Taxonomy

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 › Design Tips and Tricks › Custom Post Types by Taxonomy

This topic is: not resolved

Tagged: Agentpress, AgentPress Listings, custom post types, Details, Listing Types, taxonomy

  • This topic has 1 reply, 1 voice, and was last updated 9 years, 4 months ago by BrandonPDuncan.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • September 4, 2013 at 10:35 am #60659
    BrandonPDuncan
    Member

    Mornin' all!

    I'm trying to accomplish a filter/CPT of sorts inside of AgentPress and AgentPress Listings. Essentially, I want to create three custom listings:

    Eateries, Events, and Destinations.

    The issue is not setting the types, it's getting the correct "details" to show.

    Since categories are not set with the listings, I thought I could use the following, since the "type" of place is a custom taxonomy:

    function agentpress_property_details_filter( $details ) {
    if ( !taxonomy_exists('29'))
    $details['col1'] = array(
    __( 'Cost:', 'apl' ) => '_listing_price',
    __( 'Address:', 'apl' ) => '_listing_address',
    __( 'City:', 'apl' ) => '_listing_city',
    __( 'State:', 'apl' ) => '_listing_state',
    __( 'ZIP:', 'apl' ) => '_listing_zip'
    );
    $details['col2'] = array(
    __( 'Cuisine:', 'apl' ) => '_listing_mls',
    __( 'Reservations needed?', 'apl' ) => '_listing_sqft',
    __( 'Bedrooms:', 'apl' ) => '_listing_bedrooms',
    __( 'Bathrooms:', 'apl' ) => '_listing_bathrooms',
    __( 'Basement:', 'apl' ) => '_listing_basement'
    );

    if ( taxonomy_exists('29'))
    $details['col1'] = array(
    __( 'Stuff:', 'apl' ) => '_listing_price',
    __( 'Address:', 'apl' ) => '_listing_address',
    __( 'City:', 'apl' ) => '_listing_city',
    __( 'State:', 'apl' ) => '_listing_state',
    __( 'ZIP:', 'apl' ) => '_listing_zip'
    );
    $details['col2'] = array(
    __( 'MLS #:', 'apl' ) => '_listing_mls',
    __( 'Square Feet:', 'apl' ) => '_listing_sqft',
    __( 'Bedrooms:', 'apl' ) => '_listing_bedrooms',
    __( 'Bathrooms:', 'apl' ) => '_listing_bathrooms',
    __( 'Basement:', 'apl' ) => '_listing_basement'
    );

    return $details;
    }

    Notice in the code that if the Taxonomy ID is 29 for "eatery", I want to change the details to restaurant-ish details, but when it is a destination or event, they will be tailored to those kinds of places.

    It works fine when I set the !taxonomy_exists, but not when it IS that taxonomy. I have also tried the alphabetical taxonomy instead of the Tax ID, but get the same result. Is there another way to filter this?
    It should be an easy "if" function/array, but without categories, I'm stuck on how to set it. Especially since is_taxonomy is deprecated.

    Any suggestions besides paying $1,200 for custom coding?

    Thanks!

    http://DadsRoundTable.com/writeonetheroad
    September 5, 2013 at 5:47 am #60806
    BrandonPDuncan
    Member

    Sorry, the site is http://dadsroundtable.com/writeontheroad. There's nothing really there yet, however. I'm just starting the structure.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2023 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