Prepending place page titles

This topic contains 3 replies, has 2 voices, and was last updated by  Guust 8 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #67684

    nickd
    Expired Member
    Post count: 4

    Hi Guys,

    I am using the following function to append “Reviews for ” to each businesses place page, but for some reason the function fails to affect two of the 10 sample listings I added to my Dir.

    Echoing post type confirms that the unaffected pages are using the same custom post type as other place pages the function works fine on:

    /* append “review ” to place page titles */
    add_filter( ‘the_title’, ‘change_title’, 10, 2 );
    function change_title( $title, $postid ) {
    global $post;
    $text = ‘Reviews for ‘;

    if( get_post_type() == gd_place && $title == $post->post_title ){

    return $text . $title;
    }
    else {

    return $title;
    }
    }

    Any ideas what could be the cause of this?
    URL is: http://www.yorkshirelink.co.uk/

    #67685

    nickd
    Expired Member
    Post count: 4

    Ps if you click “view all” on the “latest places” homepage sidebar, you will see which listings are not affected, since their titles don’t have “Reviews For”

    #67686

    nickd
    Expired Member
    Post count: 4

    NVM, I figured it out, unescaped ampersands in page title.. Doh!

    #67689

    Guust
    Moderator
    Post count: 29970

    Thanks for letting us know.

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket