WordPress.org

Ready to get started?Download WordPress

Forums

Changing anchor of categorie links (4 posts)

  1. dziber
    Member
    Posted 2 years ago #

    I want to add a keyword in anchor of all categorie links. The keyword is same for all categories. How can I do that?

    example
    <a href="http://www.example.com">KEYWORD categorie</a>

    Thanks,
    Dziber

  2. shaile
    Member
    Posted 2 years ago #

    hi

    Go to your theme and find content.php then find $categories_lists
    and replace $categories_lists to 'KEYWORD categorie'.(If theme is twentyeleven)
    But if it is twentyten then find loop.php then find get_the_category_list( ', ' ) and replace get_the_category_list( ', ' ) to 'Keyword' ;

  3. dziber
    Member
    Posted 2 years ago #

    Actually I need to add a keyword to the_category() echo.
    <a href="http://www.example.com">KEYWORD category</a>
    instead of
    <a href="http://www.example.com">category</a>
    so for every category anchor there should be same keyword in it.

    <a href="http://www.example.com">KEYWORD first_category</a>
    <a href="http://www.example.com">KEYWORD second_category</a>

    if I would do what you said then the anchor text would be same on all categories.

  4. shaile
    Member
    Posted 2 years ago #

    ok you can use
    $category = get_the_category() ;
    echo "KEYWORD".$category;

Topic Closed

This topic has been closed to new replies.

About this Topic