WordPress.org

Forums

Attitude
Remove hyperlink on page titles (10 posts)

  1. doug.maynard
    Member
    Posted 2 years ago #

    Hi,

    Can anyone help me find the file/code to fix so that page titles do not have hyperlinks to themselves? I'm guessing this has something to do with .entry-title but I'm not sure exactly what to change and where. On one support thread they suggested there is an HTML tag in page.php but mine has none.

    My web page is: http://gohwp.org but go here to see one of the pages affected by this (since the home page has had the title removed):

    http://gohwp.org/who-we-are/

    You can see that I've made it so that page titles are the same color when hovered over, but the hyperlink is still there.

    Thanks!
    ~Doug

  2. simple1
    Member
    Posted 2 years ago #

    Depending on which theme you're using you may be able to remove the link from index.php http://wordpress.org/support/topic/how-do-i-remove-the-link-from-a-post-title?replies=3

  3. doug.maynard
    Member
    Posted 2 years ago #

    Thanks, simple1, but there is no "a href" element located in index.php either. I also looked in contentrightsidebar.php since that seems to fit my page's current configuration, but also came up empty there.

    I'm using the a child theme based on the Attitude theme (which is why I posted my request for help in this particular sub-forum).

  4. simple1
    Member
    Posted 2 years ago #

    Within the Attitude directory go to library > structure > content-extensions.php

    On line 117, you'll find the code for the links. You can comment out/edit the code to remove the title hyperlink for the main display. I think you can do the same for titles of a single post display within the same file, if you want to remove all title hyperlinks.

    Hope that makes sense.

  5. doug.maynard
    Member
    Posted 2 years ago #

    Thanks for this - long story short, it didn't seem to work. But let me share what I did.

    It looks like the right code, and I found it seven times in this file, on the following lines:

    • 117 (archive loop content)
    • 200 (page content)
    • 271 (single post content)
    • 368 (search results)
    • 426 (content of page template blog image large content)
    • 518 (content of page template blog image medium content)
    • 611 (content of page template full content display)

    I copied the file over to my child theme (this php file doesn't appear on the list of the parent theme files under Appearance > Editor for some reason, but when I dropped the file into the child theme folder, it did).

    Then I removed each of the above instances of the file, refreshed the browser cache, and for some reason, all page and post titles still are hyperlinked.

    Anything else I can try? Anything I did wrong?

    Thanks again!

  6. simple1
    Member
    Posted 2 years ago #

    That's good practice to work with a child theme. Sometimes I forget to do that.

    I finally figured out that you have to override the format functions through your child theme. Paste the relevant format functions from content-extensions.php into an empty function.php file (with opening and closing PHP tags) and save it in your child theme. In your case, it would be lines 95 to 670. Make your hyperlink edits. It should override the parent functions.

  7. doug.maynard
    Member
    Posted 2 years ago #

    Thanks again for continuing to work with me on this, simple1. I got rid of the child theme file "content-extensions.php," copied the section of code into a blank file in notepad++, saved it as "function.php", FTPed it into the child theme and edited out the a href statements. Finally, I refreshed the cache. Unfortunately, following these steps didn't seem to change anything, so I guess for me it hasn't overridden the parent theme code for some reason.

    I can always do a workaround (that is, edit my style.css to have the titles not show on those pages, then add the words of the title at the top of those pages with the appropriate heading level). I think that would do it, but I'm trying to learn to do it the proper way (so it will apply across the board including future pages).

  8. simple1
    Member
    Posted 2 years ago #

    Hmmm, I'm not sure why it's not working. I tested it out and I was able to disable the hyperlinks. I referred to this page (sections on Overriding Templates and Overriding Functions) http://ottopress.com/2010/wordpress-protip-child-themes/

  9. cristianalbu303
    Member
    Posted 2 years ago #

    Hmmm, I'm not sure why it's not working. I tested it out and I was able to disable the hyperlinks. I referred to this page (sections on Overriding Templates and Overriding Functions) http://ottopress.com/2010/wordpress-protip-child-themes/

    Hello simple1/doug.maynard,

    So, did you find a working solution for removing removing the hyperlinks from the site title and page title? I'm eating my brains here trying to remove those links from titles. The support forum for this theme is..... Will wait your answer. Thanks.

  10. doug.maynard
    Member
    Posted 2 years ago #

    Unfortunately, no. I did the workaround that I mentioned, which, for a small website like ours, is not a big deal.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic