Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. Share your own thoughts and experience, accounts may be terminated for violations.
  • Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

Add text to Category link

Status
Not open for further replies.
Joined
Apr 19, 2010
Posts
1,446
Reaction score
13
Been searching for this and trying for the last hour and I cant seem to find a solution.

Does anyone know how I add a word to the Wordpress Category link and make them part of the clickable link:

<div class="category"><?php the_category(', ')?></div>

I know I can add words to it but those are not clickable, but how do i make them part of the link so they are clickable?

Many thanks.
 
Thanks Pete, sorry for my limited knowledge but how do I implement this?

Have tried different versions of the code but I keep getting an error message.

Thanks again.
 
I think it probably only works within the loop. I don't really know where you are trying to put it?

This code would work for showing a link to the current category.

<a href="<?php echo get_category_link($category->cat_ID); ?>">Blah <?php echo $category->cat_name; ?></a>
 
I think it probably only works within the loop. I don't really know where you are trying to put it?

This code would work for showing a link to the current category.

<a href="<?php echo get_category_link($category->cat_ID); ?>">Blah <?php echo $category->cat_name; ?></a>

Thanks Peter, tried that but now the category just points to the homepage of the website, not to the actual category the article is posted in.

I have tried to replace the original code with the code above.
 
PM (or post here if you don't mind) the template which you want to update.
 
Thanks Peter, tried that but now the category just points to the homepage of the website, not to the actual category the article is posted in.

I have tried to replace the original code with the code above.

The way I understand it, you are trying to add a category then click it and it redirects to the proper category of your site. Have I understand it right? It should not be much of a problem.
 
Status
Not open for further replies.
Top Bottom