Celebrating 7 Years! Get up to $30 off GeneratePress Premium!

[Support request] Single Blog Post Title as a Link

Home Forums Support [Support request] Single Blog Post Title as a Link

Home Forums Support Single Blog Post Title as a Link

  • This topic has 3 replies, 3 voices, and was last updated 3 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #549276
    Toby

    I’d like the blog post title (single) to be a link (to that blog URL).

    Is it possible to edit somewhere?

    GeneratePress 2.0.2
    GP Premium 1.6.2
    #549594
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure if I understand, you are wanting the single post title to link to the main blog page?

    Let me know.

    #550053
    Toby

    Hi Leo,

    I want the single post H1 to link to that particular post.

    #550364
    Tom
    Lead Developer
    Lead Developer

    Linking to the page you’re currently on isn’t typically recommended, but it’s possible with a child theme.

    You’d need to copy the current content-single.php file from the parent theme into your child theme.

    Then replace this:

    if ( generate_show_title() ) {
        the_title( '<h1 class="entry-title" itemprop="headline">', '</h1>' );
    }

    With this:

    if ( generate_show_title() ) {
        the_title( sprintf( '<h1 class="entry-title" itemprop="headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.