• Resolved mipqim

    (@yoencaz)


    Hi.

    Down below you see the archive pages where I want to remove the first slug (since the second slug is the actual category).

    /new_products_categories/new-products/

    Problem:
    When I am using standard WordPress posts it seems like there is only one slug for the particular category (when at the archive page for that particular category) –> /category.
    This is the way I want it to be for my custom post types archive as well.

    So, I guess what I am trying to say: I want to create a custom-post-type-category and an archive page for that category. On this archive page I want the slug to be –> /category. And when going to one particular post within this category the slug should be /category/post-name.
    Is there like a quick fix in the WordPress dashboard to solve this, or do I need to add some PHP code in the functions.php ?

    Merry christmas and thanks in advance 😀

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I have to believe this is going to be a php code solution overall, however I’m not quite following what you’re aiming for either. You have a mix of post type references, custom taxonomy references, and the default category taxonomy reference.

    mysite.com/category/some-cat/ would be a term archive for the “some-cat” term from the category list.

    your provided link at the very end looks like a “stories” custom taxonomy with a term named “stories” as well.

    One of the biggest things you’re going to run into if you’re trying to have a custom taxonomy that points to mysite.com/category/ is that you’re going to conflict with the out-of-box categories. It’s also not going to be a post type archive.

    Perhaps some concrete examples of url’s you’re wanting will help me provide at least some guidance on how to achieve that.

    Thread Starter mipqim

    (@yoencaz)

    Concrete example:

    My aim:
    I want an archive page for all my posts that belongs to the category “stories”. I want this page to have this URL –> https://yoenca.com/stories
    When clicking on any post at this archive page I want to be directed to the URL
    –> https://yoenca.com/stories/nameofpost

    Today it looks like this:
    https://yoenca.com/stories/stories/
    When clicking on the first post, the one having a featured image on a women (named: Viktoria Widengren), you get directed to this URL –> https://yoenca.com/storiespost/viktoria-widengren/

    Am I explaining myself better now?

    Thank you so much for the quick reply and pushing my problem towards a possible solution!!

    //Yoenca

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Observations:

    https://yoenca.com/stories

    Feels more like a custom post type of “stories” as opposed to a category. Treating “stories” as a post type would still allow for the desired archive as well.

    https://yoenca.com/stories/stories feels like it could be inching towards /post-type-slug/taxonomy-slug/ or based on the <body> tag, more of a taxonomy of stories and a term of stories, which also makes sense based on the url.

    Based on the last url provided, you have a post type of “storiespost” and Viktoria has her own permalink.

    So, at least if I’m following things correctly, the quickest way to get to the desired https://yoenca.com/stories/nameofpost url would be make “stories” the post type slug, and not worry about “stories” being a taxonomy/category.

    All a matter of juggling content and content types 😀

    Thread Starter mipqim

    (@yoencaz)

    Just wanted to say thanks for your help. I have not had time to look into this but I will. We can close this matter now.

    Again super thanks!!
    Hannes

    • This reply was modified 6 years, 5 months ago by mipqim.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove extra slug’ is closed to new replies.