Streamlining WordPress: Removing Category and Tags in Oxygen Builder

Web Development & Design
Surfer AI - Best All-in-one Assistant

- Your article will be ready in less than 20 minutes and it will be 10 times cheaper than using a dedicated writer.
- Create ready-to-rank articles in minutes with Surfer AI.
- Research, write, and optimize across industries with the click of a button.


If you happen to be striving to get rid of the “Group: ” and “Tags: ” prefix that comes when striving to produce dynamic obtain pages in Oxygen, you happen to be not alone.

To get rid of this, you can set up a php code snippet and then contact that perform to get rid of the prefix. Here is how:

Getting rid of Group Archive Insert in Oxygen Builder

If you happen to be exhausted of seeing the identify in front of your group/tag/customized archive you can very easily get rid of it.

Archive prefix with and without the prefix in Oxygen builder.Archive prefix with and without the prefix in Oxygen builder.

You may need to have a code snippets plugin to do this. I like the Code Snippets a single given that it really is super effortless to integrate. 1 you include the plugin, include a new php snippet and paste the following code:

include_filter( 'get_the_archive_title', 'my_theme_archive_title' )
/**
 * Take away archive labels.
 * 
 * @param  string $title Existing archive title to be displayed.
 * @return string        Modified archive title to be displayed.
 */
perform my_theme_archive_title( $title ) {
    if ( is_group() ) {
        $title = single_cat_title( '', false )
    } elseif ( is_tag() ) {
        $title = single_tag_title( '', false )
    } elseif ( is_writer() ) {
        $title = '<span class="vcard">' . get_the_writer() . '</span>'
    } elseif ( is_publish_kind_archive() ) {
        $title = publish_kind_archive_title( '', false )
    } elseif ( is_tax() ) {
        $title = single_phrase_title( '', false )
    }

    return $title
}
Archive prefix Oxygen builder function to truncate the category or tag titlesArchive prefix Oxygen builder function to truncate the category or tag titles

As soon as you happen to be completed, as an alternative of employing the archive title dynamic information you are going to just use a php perform contact and exchange it with the identify of the code snippet: get_the_archive_title:

Insert custom PHP function return value in Oxygen BuilderInsert custom PHP function return value in Oxygen Builder

Which is it! You will not have the prefix any longer. You ought to see the identify itself (I additional the word blogs right after just since I desired to):

Final removed archive category text showing just the category name in Oxygen builderFinal removed archive category text showing just the category name in Oxygen builder

Hope this assisted! Drop a comment if you have any queries

タイトルとURLをコピーしました