Community Forums › Forums › Archived Forums › General Discussion › Disabling link on post title
Tagged: disable post title link
- This topic has 18 replies, 3 voices, and was last updated 11 years ago by Ben Siegfried.
-
AuthorPosts
-
March 30, 2013 at 1:25 pm #32122Ben SiegfriedMember
Is it possible to disable the post title link so that it doesn't link to anything. How would this be done if possible?
I want to created a post but not have it link to its own post page.
March 30, 2013 at 2:12 pm #32128SusanModeratorI am assuming you are not talking about something in a featured post/page area (because I would offer another suggestion for that.)
To disable a link clicking to the post - Put the post in edit mode, then scroll down to Custom Redirect URI and place the URL of another page on your site in that spot.
March 30, 2013 at 2:22 pm #32130Ben SiegfriedMemberI don't follow what you are saying. I don't even see a Custom Redirect URI area anywhere when I put a post in edit mode.
Ok, so the Blog page where the post show up I want those Title links to NOT go to the individual blog post. I want to be able to add a new post and have it show up on the Blog page with full content showing, but have the Title of each blog post to not link to each post's page.
March 30, 2013 at 3:47 pm #32138March 30, 2013 at 3:50 pm #32141Ben SiegfriedMemberI'm using SEO by Yoast, is that the same as a 301 redirect?
March 30, 2013 at 3:57 pm #32142SusanModeratorI haven't used SEO by Yoast myself, so I couldn't address what that does, but the custom redirect URI is a 301 redirect.
March 30, 2013 at 4:03 pm #32143Ben SiegfriedMemberOk cool, Yoast has it, it is just in a tabbed UI on each page. Maybe that will a solution for me.
March 30, 2013 at 4:05 pm #32144SusanModeratorGreat! Let me know if you have any other questions!
March 31, 2013 at 2:15 pm #32320Ben SiegfriedMemberWell I think you showed me something different than what I wanted. I want to disable the post title link. The is hoverable and links to the page for that individual post. I want to disable the link from going to the post's individual page. In other words, I want to use posts to add new posts on the list of posts but I don't want any of them to link to their individual pages—I want to disable their title text links.
March 31, 2013 at 2:21 pm #32322SusanModeratorI don't know of a way to disable the links - the method I suggested was to redirect the link, and it works on my test site.
Go to my >test site.See the first post; click on the first post and see where it takes you. Yes, it redirects you, but it doesn't take you to the actual post. I thought that was what you were looking for.
March 31, 2013 at 2:25 pm #32323SusanModeratorOtherwise, try this tutorial:
March 31, 2013 at 2:40 pm #32326Ben SiegfriedMemberOk, I get the redirect idea now. I just redirected it to the url it is already on, so the page just recycles to the same url—this does stop the title link from going to the post's individual page. I'd like to just turn off the title link altogether. I'll try that with CSS.
March 31, 2013 at 2:59 pm #32334Ben SiegfriedMemberI should have known better that CSS wouldn't do anything but change it's styling.
There is no single.php page in the Editor for the Child Theme. There is in Genesis but we aren't supposed to alter the Genesis core, only the Child Theme. I understand that it requires removing the <a href=""></a> tag and attribute, but I don't know how to do that without finding it first. So, where would I find that in Agency's theme?
March 31, 2013 at 3:03 pm #32336SusanModeratorYou are right, you aren't supposed to alter the Genesis core, but you could overwrite the Agency functions.php or home.php, or add something to functions.php to override the core. I'm not a PHP expert, so I'm not sure where to direct you, but let me do a little more research.
March 31, 2013 at 3:09 pm #32338Ben SiegfriedMemberWell thanks for looking around Susan.
This post is still unresolved. Anyone know how to disable the <a href=""></a> for the Post Title?
March 31, 2013 at 3:24 pm #32341cdilsParticipantHi there,
Sorry I'm not clear - Are you talking about on the archive page where it shows multiple posts or on a single post page?For a single post page, you could filter the post title, like this:
http://adamcap.com/code/filter-genesis-h1-post-titles-to-add-for-styling/
You could change the conditional from is_singular to is_archive if you need to target the archive page instead.
Carrie
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
March 31, 2013 at 3:32 pm #32343Ben SiegfriedMemberI mean exactly this, disable <a href="">Post Title</a>, which would, I guess affect all post titles, and I don't mind this because I'm only using one page and don't need archive, etc.
March 31, 2013 at 7:31 pm #32376cdilsParticipantThen that filter code should work for you - just remove the conditional statement around it.
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
March 31, 2013 at 8:03 pm #32377Ben SiegfriedMemberThanks cdils that works. You saying "You could change the conditional from is_singular to is_archive if you need to target the archive page instead," is what tipped off my solution. I'm actually commenting out lines of code in the home.php of Agency to bring in the blog posts on that page.
<code>//remove_action( 'genesis_loop', 'genesis_do_loop' );
//add_action( 'genesis_loop', 'agency_home_loop_helper' );
//add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );</code>So, in my situation I targeted "is_home" and installed that into the functions.php file.
<code>
/**
* Filter Genesis H1 Post Titles to add <span> for styling
*
*/
add_filter( 'genesis_post_title_output', 'ac_post_title_output', 15 );function ac_post_title_output( $title ) {
if ( is_home() )
$title = sprintf( '<h2 class="entry-title"><span>%s</span></h2>', apply_filters( 'genesis_post_title_text', get_the_title() ) );return $title;
}</code>
-
AuthorPosts
- The topic ‘Disabling link on post title’ is closed to new replies.