Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6121001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:44:02+00:00 2026-05-23T15:44:02+00:00

Currently I’m building a new WP theme. I’m a designer and have only basic

  • 0

Currently I’m building a new WP theme. I’m a designer and have only basic knowledge of PHP. So for breadcrumbs, I used Dimox’s script.

But from an SEO point of view, I want to add the rel=”cat” and rel=”tag” to categories and tag links respectively in the breadcrumbs. I asked him, but he couldn’t provide a solution. So if any WP developer can help me out in this it would be great.

Here is the Exact piece of code for the category link.

else {
        $cat = get_the_category(); $cat = $cat[0];
        echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
        echo $before . get_the_title() . $after;
      }

So I want to assign a rel=”cat” tag to the category link which is created by the get_the_category function.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:44:03+00:00Added an answer on May 23, 2026 at 3:44 pm

    Change line 45 of the original code to:

    if ($cat->parent != 0){
        $parents = array_reverse(get_ancestors($cat->cat_ID, 'category'));
        foreach($parents as $parent_id){
            $parent = get_category($parent_id);
            echo '<a rel="cat" href="'.get_category_link($parent->cat_ID).'" title="'.esc_attr(sprintf(__( "View all posts in %s" ), $parent->name)).'">'.$parent->name.'</a> '.$delimiter.' ';
        }
    }
    
    echo '<a rel="cat" href="'.get_category_link($cat->cat_ID).'" title="'.esc_attr(sprintf(__( "View all posts in %s" ), $cat->name)).'">'.$cat->name.'</a> '.$delimiter.' ';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.
Currently I know of only two ways to cache data (I use PHP but
Currently, I have: <html> <div class=yes1><span><img src=img></span></div> </html> <script> var x = ='yes1' var
currently we have a column with only integer values declared as NUMBER. At the
Currently createPopup() is only supported in IE (See http://help.dottoro.com/ljsxcrhv.php ). Is there a universal
I want use html5's new tag to play a wav file (currently only supported
Currently, the only information I have is a one-line error message in the browser's
Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and
Currently we have a project with a standard subversion repository layout of: ./trunk ./branches
Currently, if I want to output a SQL script for a table in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.