Custom Post Types by Taxonomy

Community Forums Forums Design Tips and Tricks Custom Post Types by Taxonomy

This topic is: not resolved

This topic contains 1 reply, has 1 voice, and was last updated by  BrandonPDuncan 7 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #60659

    BrandonPDuncan
    Participant
    Post count: 1

    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
    #60806

    BrandonPDuncan
    Participant
    Post count: 1

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

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

You must be logged in to reply to this topic.