Filter query_posts by tag slug on “Tag Archive” page (when tag is 2 or more words)

I’m using the following to bring up a tag archive page: <?php query_posts( “tag=”. ” . single_tag_title( ”, false ) . ” ); ?> This works perfectly for all tags of one word only, but any tags of more than one word (eg: “tag one”, slug: “tag-one”) do not display. Is it possible to query_posts … Read more

Prevent page slug from interfering with custom post type archive permalink?

In my plugin, I’m creating a custom post type that has an archive and uses the rewrite parameter to choose a slug: $args = array ( ‘public’ => true, ‘has_archive’ => true, ‘rewrite’ => array(‘slug’ => ‘lessons’, ‘with_front’ => false) ); register_post_type (‘my_plugin_lesson’, $args); With this code, I get an archive of the ‘my_plugin_lesson’ posts … Read more

Custom post type with slug for plural (archive) and for single

I’ve been searching a way to have kind of “two” slugs for a custom post, let me give an example: www.mywebsite.com/articles/ or www.mywebsite.com/articles/page/2/ for the archive www.mywebsite.com/article/%post-name%/ for the single custom post 1 Answer 1 Both of these are controlled by the arguments passed to register_post_type, specifically, the rewrite and has_archive arguments: $args = [ … Read more

Custom Taxonomy leads to 404 page

Followings are the codes I added in my theme function.php file // Taxonomy Resource $labels = array( ‘name’ => ‘Resources’, ‘singular_name’ => ‘Resource’, ‘search_items’ => ‘Search Resource’, ‘all_items’ => ‘All Resource’, ‘parent_item’ => ‘Parent Resource’, ‘parent_item_colon’ => ‘Parent Resource:’, ‘edit_item’ => ‘Edit Resource’, ‘update_item’ => ‘Update Resource’, ‘add_new_item’ => ‘Add New Resource’, ‘new_item_name’ => ‘New … Read more

Show all wp_get_post_terms slugs

I am using the following code to display my custom taxonomy slugs. However it is only displaying the first category and not all the related categories. I know this is fairly simple and is to do with [0] but I can’t figure out how to change it. $getslugid = wp_get_post_terms( $post->ID, ‘opd_taggallery’ ); $getslug = … Read more

Remove Author Slug & Replace With Username

I reviewed all related questions but none tackle this exactly so I’m posting the question in hopes the pro’s know how to handle this. I would like to change the author slug to remove the term /author/ completely like this; currently example.com/author/username want example.com/username Moreover I’d like all posts related to an author to look … Read more

Template for slug

I am using the “Edit Author Slug” plugin to provide public profile pages on my site using the following structure: mysite.com/users/username. Now, I want to show a list of all users on mysite.com/users/. But this returns a 404 because the “users” path is only a slug created by the plugin. Does WP provide the possibility … Read more

Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure

this is my situation: I have a Custom Post Type named struttura (like accommodation): function custom_post_struttura() { $labels = array( ‘name’ => _x( ‘Strutture’, ‘post type general name’ ), ‘singular_name’ => _x( ‘Struttura’, ‘post type singular name’ ), ‘add_new’ => _x( ‘Aggiungi nuova’, ‘book’ ), ‘add_new_item’ => __( ‘Aggiungi nuova Struttura’ ), ‘edit_item’ => __( … Read more