0

Lets say you have a custom template and you want to implement a title of Wordpress template for section /category/general where general is a category name .

How to implement category page titile for this page .

I tried with

  <h2><a href="#" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?    >"><?php the_title(); ?></a></h2>

But this does not work as a clickable link .

2
  • Clickable link to what? :)
    – Rarst
    Sep 18, 2015 at 17:50
  • Clickable link to Post offcource. The page title should land to its post when clicked on category.php page . Sep 19, 2015 at 5:16

2 Answers 2

0

Your code is fine, the only problem here is a syntax error. Always remember to remove any spaces between the opening and closing tags - otherwise your code will fail.

Example:

<h2>
    <a href="#" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
        <?php the_title(); ?>
    </a>
</h2>

Make sure to read the Wordpress Codex about the_title_attribute() to understand better on how to customize this function: https://codex.wordpress.org/Function_Reference/the_title_attribute

0

If you want to link to the current post inside the loop, you need to provide respective URL in the markup.

In your snippet href="#" should probably be href="<?php the_permalink(); ?>".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.