WordPress.org

Ready to get started?Download WordPress

Forums

How do you use breadcrumb-like URLs for posts? (1 post)

  1. soret
    Member
    Posted 1 year ago #

    Hello! I'm new to WordPress, and really working hard into obtaining at least the same level I had with Joomla. Up until now, I like WP much better... But there is still one thing I need to cover before I can say I have migrated completely. It's very important for me, and I've searched everywhere for a solution, honest, but with no luck.

    What I'm desperately looking for is a specific friendly URL structure. I would like the URLs to tell where a post comes from. For instance, when you organize pages, you can obtain something like "www.mydomain.com/page-level-1/page-level-2/", which is great.

    The problem comes when I try to add a post to a specific page. I have managed to come around that problem by making a new page template with this code here:

    <?php
    global $more;
    $more = 0;
    query_posts('cat=12');
    if(have_posts()) :
    while(have_posts()) :the_post();
    ?>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
    <div><?php the_content('Read More') ?></div>
    <?php
    endwhile;
    endif;
    wp_reset_query();?>

    and it will show the posts that are in the category 12 thanks to the "cat=12".

    However, whenever I click on a post, no matter the category it is in, the URL structure changes to "www.mydomain.com/name-of-post/". I know this is set under "permalink settings". I set it like this because it was the option I had that was closer to what I wanted, but what I really want is something like "www.mydomain.com/page-level-1/page-level-2/name-of-post/". More like a breadcrumb-type URL.

    I was surprised to see that most of the pages in the Showcase of Worpress didn't have it like this. But, I noticed that Usain Bolt's page did have very well organized breadcrumbs, despite the "year-month-title" URL structure... So i guess it IS possible.

    I really hope a more experienced user has had the same problem and has come up with a solution to this! Anyway, I will appreciate all the help you can give me, and thank you all very much in advance.

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic