Articles of custom taxonomy

Display posts with tag for custom post type only

I have this is my functions.php file to create tags only for custom post type called ‘image-gallery’: register_taxonomy( ‘image-gallery_tags’, ‘image-gallery’, array( ‘label’ => __( ‘Image Tags’ ), ‘rewrite’ => false, ‘hierarchical’ => false, ‘capabilities’ => array( ‘edit_terms’ => ‘manage_categories’ ) ) ); But I can’t get the list of tags to show in the post […]

Can't use pagination with custom taxonomy

I have a problem with custom taxonomies & post types URLs. My post type slug is videos, it has an archive and it works fine: https://uwebdesign.ru/videos/. The pagination on the bottom of the page works like a charm. My taxonomy slug is video_type, but I rewrite the slug to be videos, than all the taxonomy […]

Having Issue on Passing Variable into HTML Class Tag

Working in WordPress PHP I am trying to pass a value into class tag of an element <div class=”element-item”></div> to be like <div class=”element-item comedy”></div> $term = get_the_term_list( get_the_ID(), ‘type’ ); echo ‘<div class=”element-item ‘.$term.'”>’; the value is pupping out of the class tag and display on the page! I checked the source code and […]

What order? register_taxonomy() register_taxonomy_for_object_type() register_post_type()

In what order are these functions supposed to be called? register_taxonomy( $catname, $cpt ); register_taxonomy_for_object_type( $catname, $cpt); register_post_type( $cpt, $args );//without the taxonomies argument

Loop through custom taxanomy in post and display custom fields from posts

I will try to elaborate the title. I want to make a post, within this post I want to loop through all posts from a custom taxanomy and extract custom fields. How is this done in the most efficient way? What I am thinking about is using the template hierarchy: single-post-{slug}.php Within this I get […]

Displaying posts that belong to a specific author

I am a drupal developer who is trying help out a friend with this task. I have a custom team post that has all the team members of the company and they sometimes post an article about their cases. If the user creates a post it gets a link of: and I want to direct […]

tax_query not working

I have tried using the id, slug, name, and take the tax_query as an array of arrays but still it will output all the posts from that post type. Here’s my custom taxonomy, ‘Event Specific’: function theme_event_category(){ $labels = array( ‘name’ => ‘Event Specifics’, ‘singular_name’=> ‘Specific’, ‘search_items’ => ‘Search Event Specifics’, ‘all_items’ => ‘All Event […]

export and import taxonomy terms from one taxonomy to another

I have a custom taxonomy named “places” and another taxonomy named “featured places”. On the “places” taxonomy i have 150 terms (names of places) and i want those same 150 names (terms) on the “featured places” taxonomy. Is there a way to just export the terms from the “places” taxonomy and export it into the […]

Reusable metabox backend and frontend

I am trying to create a more transferrable/automated custom post type that would act as a error ticketing system (I know there are many out there, but I want one that is completely customised). The CPT I have is called ticket with two taxonomies ticket_stage and ticket_application. I also have the meta fields: closed – […]

CPT Search Form with Taxonomy filter & Or

I currently use the form below : <form role=”search” method=”get” class=”search-form” action=”<?php echo home_url( ‘/’ ); ?>”> <input type=”search” class=”search-field” placeholder=”<?php echo esc_attr_x( ‘Type Business or Town’, ‘placeholder’ ) ?>” value=”<?php echo get_search_query() ?>” name=”s” title=”<?php echo esc_attr_x( ‘Search for:’, ‘label’ ) ?>” /> <input type=”text” value=”<?php echo get_query_var(‘location’); ?>” name=”location” id=”location” class=”headersearch location” placeholder=”<?php […]