• Hi,

    I would like to add some text to the beginning of my post title, in all my posts.

    I have looked at various files [single.php etc] but can’t find where to place my text in the code.

    Any help would be much appreciated!

    ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and having access to an unedited version of the theme is vital when dealing with a range of site issues. Create a child theme for your changes.

    You can download a pre-made Twenty Eleven child theme from here.

    Look for <?php the_title(); ?>. And put some text in front of it.
    Template files you have to edit and put in your child theme:
    content-aside.php
    content-featured.php
    content-gallery.php
    content-image.php
    content-intro.php
    content-link.php
    content-page.php
    content-quote.php
    content-single.php
    content-status.php
    content.php
    image.php
    showcase.php

    Moderator keesiemeijer

    (@keesiemeijer)

    Or put this in your child theme’s functions.php:

    add_filter('the_title','before_title');
    function before_title($title){
    // change 'my text before title ' to what you want to appear before the title
    return 'my text before title ' . $title;
    }

    Thread Starter Devon Steel Fabrication

    (@devon-steel-fabrication)

    Many thanks keesiemeijer, that’s got it sorted!

    :O)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Amend 'Post Title' in Twenty Eleven?’ is closed to new replies.