Disabling link on post title

Community Forums Forums General Discussion Disabling link on post title

This topic is: resolved

This topic contains 18 replies, has 3 voices, and was last updated by  benjeeno 1 year, 3 months ago.

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #32341

    cdils
    Participant
    Post count: 420

    Hi 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 tweet @cdils.

    #32343

    benjeeno
    Participant
    Post count: 248

    I 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.

    #32376

    cdils
    Participant
    Post count: 420

    Then 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 tweet @cdils.

    #32377

    benjeeno
    Participant
    Post count: 248

    Thanks 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>

Viewing 4 posts - 16 through 19 (of 19 total)

The topic ‘Disabling link on post title’ is closed to new replies.