Viewing 5 replies - 1 through 5 (of 5 total)
  • I may be able to help with this. Could you give a more detailed description of what you’re trying to do? Thanks.

    Thread Starter bongkph

    (@bongkph)

    I am using a wp-o-matic that aggregates feeds. A certain rss from a site have this default word before the title. Ex of ArticlePost Title is “Word : The Post Title”

    On that instance, I would like to automatically delete or replace the “Word” so that only the title of the article will be displayed.

    This isn’t very elegant, but you could try editing line 601 of wpomatic.php, replacing:

    $wpdb->escape($item->get_title())

    with

    preg_replace(‘/Text to be Removed/’,”,$wpdb->escape($item->get_title()))

    I’m not exactly familiar with this plugin (I just downloaded it for the first time), so if this doesn’t work then don’t be too surprised.

    Good luck.

    (N.B. This will only affect posts fetched after you’ve made the change.)

    Thread Starter bongkph

    (@bongkph)

    Technokinetics, it works great. Another 2 more questions please. It leaves 1 space before the first character.

    Also is this code allowed for multiple phrases? like “Word : The Post Title” and there is another “Another Word : The Post Title”

    Thanks a lot.

    To get rid of the space, include it in the text to be removed:

    preg_replace(‘/Text to be Removed /’,”,$wpdb->escape($item->get_title()))

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Replace Word in Post Title’ is closed to new replies.