• Resolved markboulder

    (@markboulder)


    I created a custom taxonomy for locations by adding the following to functions.php:

    add_action( 'init', 'build_taxonomies', 0 );
    
    function build_taxonomies() {
        register_taxonomy(
            'supplier',
            'location',
            array(
                'hierarchical' => true,
                'label' => 'Supplier',
                'query_var' => true,
                'rewrite' => false
            )
        );  
    
    }

    The taxonomy shows up on locations and I’ve created some terms and assigned them to some locations. I made the file taxonomy-supplier-glass.php in my theme directory and just added the code from category.php. I went to ‘permalinks’ in wp-admin to refresh the cache. What url do I need to go to in order to see a list of locations with this custom taxonomy/term? I’ve tried mysite/locations/supplier/glass/ , mysite/supplier/glass/ , etc.. and have no luck- “couldn’t find what you are looking for” in each case. What am I missing here?

    https://www.ads-software.com/extend/plugins/events-manager/

Viewing 4 replies - 1 through 4 (of 4 total)
  • maybe this can help you out – https://pastebin.com/UMipT093

    Thread Starter markboulder

    (@markboulder)

    Thanks for that. I added it, and of course that added the events categories to locations. If that’s the only solution, though not ideal, I could work with that- however using the shortcode simply displays all the locations. I tried location_category=”Cat Name” , location_category=”2″ and location_category=2 . All show every location. Also, when I go to mysite.com/locations/cat-slug nothing shows. Likewise with mysite.com/cat-slug. What do I have to do to get either the shortcode working, or the url showing a category archive page. I would really prefer to use the custom taxonomy that I already created for locations, and display a taxonomy archive page for that. For example mysite.com/locations/cust-tax-slug/

    Thread Starter markboulder

    (@markboulder)

    I am still struggling with this, and any help would be appreciated. I added in the slug rewrite:

    'rewrite' => array(
                    'slug' => 'supplier',
                    'with_front' => false,
                    'hierarchical' => true
                ),

    and also added in a custom taxonomy to ‘posts’ just to see if it was specific to EM. It is, because I see the archive page at mysite.com/test/tesing , “test” being the cust. tax. name, and “testing” being one of the terms.

    Why is this not working for the locations taxonomy? It certainly is possible, as event categories are a custom taxonomy for a custom post (events), and are able to display pages by event category. What needs to be done to enable this same thing for my custom taxonomy on locations?

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    unfortunately I don’t have any snippets at hand to help with this… the suggestion looks ok, although I’d do it differently. however, look at line 21, replace

    EM_TAXONOMY_CATEGORY

    with ‘supplier’

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom Taxonomy Locations Page’ is closed to new replies.