• I have a question about how categories work. Assuming you were using categories as a way to organize a site, but wanted to control the url, would that be possible?

    For instance, if you had a website about sports, and click on professional sports it takes you to https://website.com/?cat=16, a page displaying only information from that category. If you were to want that to read https://website.com/prosports instead, yet still show the same information, would that be possible?

    I have been looking at it and I cannot figure out how to do this on my website. Any assisstance would be appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter leedykxhoorn

    (@leedykxhoorn)

    Thanks for the tip.

    “For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields.”

    Reading this, it seems it is not exactly best practice to link my category to start off the url, however, i am not planning a very big website, probably 3 categories total with 20-30 pages distributed between them to start off. Is that the kind of rule you can cheat a little bit? Or should I stay away from that completely?

    My other idea was to create a Page at the url that i want, and try to work up the code to make it display posts from the right category in the loop, but so far it is not working like I would want it to. Right now it just displays a link to the page itself that I am already on.

    this is the page in question: https://www.leedykxhoorn.com/blog

    and this was the code i was using to try to make the posts of that category show up.

    <div id="content-blog">
    <?php if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    	<?php require('post.php'); ?>
    <?php endwhile; ?>

    this was the category page I am trying to emulate with a page or change the permalink to. https://www.leedykxhoorn.com/category/blog

    Any ideas what I am doing wrong? Thanks for your help so far.

    Thread Starter leedykxhoorn

    (@leedykxhoorn)

    I know that forum rules forbid bumps, so this is not that in the strictest sense. It is more of a different way to phrase my question, and it seemed logical to link the two together since I still have not been able to come up with an answer on my investigation.

    I am trying to determine if it is possible to create a static page (wherein you can control the url exactly) that displays all posts within a particular category.

    Does anyone know if that is possible to do? Or am I just approaching this whole problem from the wrong angle? Any input is appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Category name display in url’ is closed to new replies.