• This plugin does not work if the theme calls the_title() / get_the_title(). The FAQ says:

    “If your theme is incorrectly using the_title(), PrettyPress hooks will automatically be applied here, thus breaking your theme.”

    I don’t agree with this. Both functions are documented in the wordpress codex and absolutely valid to use. They aren’t deprecated at all. Therefore the plugin is broken, not my theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author evasivesoftware

    (@evasivesoftware)

    Hi Jhoppe,

    Prettypress does indeed work for both the_title() and get_the_title(), it does _not_ hook the_title_attribute()

    If you there has a link like so

    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>

    Then this is unsafe, as the_title() does not escape characters for being wrapped in argument. The correct usage would be

    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a>

    Thread Starter JHoppe

    (@jhoppe)

    Thanks for replying!
    Indeed. My third-party template has code like this:

    <a title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>" href="<?php the_permalink(); ?>">

    Isn’t there a workaround? Changing the template on multiple places is not an option here.

    Plugin Author evasivesoftware

    (@evasivesoftware)

    Do you have the option to add code to functions.php? If so, try adding

    if ( function_exists('prettypress_thetitle') ) {
    	add_filter( 'get_the_title', 'prettypress_thetitle', 10, 1 );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Does not work for my theme’ is closed to new replies.