• Is it possible to change the display name of “Featured Post” to something else, for example, “About X, Y, Z”, without necessarily changing the underlying code?

    I have a sticky post plugin and though after people have given some helpful hints, I have figured out how to change the title’s font attributes and colour, I haven’t sussed out a way to use CSS and change the “Featured Post” to something different.

    My thanks in advance

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator t-p

    (@t-p)

    I have a sticky post plugin …

    I recommend asking at https://www.ads-software.com/support/plugin/sticky-posts-switch/ so the plugin’s developers and support community can help you with this.

    Thread Starter Muirén NíSídach

    (@rhomani)

    That is precisely what I did do and why I am posting here.
    https://www.ads-software.com/support/topic/customize-name-of-featured-post/
    `Support ? Plugin: Sticky Posts – Switch ? Customize Name of Featured Post?
    Muirén Ní Sídach (@rhomani)
    1 month, 2 weeks ago
    Instead of an entire page, I want the sticky-post to be the about. How can I change the words “Feature Post” to “About”?
    The page I need help with: https://siofrai.com

    Sticky Post Switch Plugin Author: Markus Wiesenhofer (@markusfroehlich)
    6 days, 10 hours ago
    Hello rhomani,
    the naming comes from WordPress itself, unfortunately, I have no influence.
    Best regards
    Markus

    Moderator bcworkz

    (@bcworkz)

    It actually comes from your theme, not WP core. The label is easily hidden with CSS, but to change it gets more complicated. If your theme runs such labels through the translation functions, the “gettext” filter can be used to alter labels going through translation. Even for English language sites, labels can still go through translation functions. But themes would have to explicitly use the system for this to work.

    If generic solutions like that don’t work for you, I’d have to refer you to the theme’s dedicated support forum:
    https://www.ads-software.com/support/theme/simplyblack/
    Sorry for the run around, but the theme’s devs and expert users at their own forum are in the best position to help you.

    Thread Starter Muirén NíSídach

    (@rhomani)

    Thanks. The Theme’s author told me to contact the plugin author, the plugin author told me it comes from WordPress. So I’ll copy this exchange for clarification and circle back around to the theme builder for a fix.

    Moderator bcworkz

    (@bcworkz)

    I checked your theme, SimplyBlack. It does use the _e() translate function, so this should work for you:

    add_filter('gettext', function( $translation, $text, $domain ) {
      if ( $text == 'Featured post') $translation = 'About X, Y, Z';
      return $translation;
    }, 10, 3 );

    To protect this code from theme updates, it’d be best if it were placed in a simple, custom plugin you could create.

    I sort of know the theme’s author, @guido07111975, they’ll get a notification of this reply. The label comes from theme file content-list.php, line 9:
    <?php _e( 'Featured post', 'simplyblack' ); ?>

    Hi ya Guido! ??

    Guido

    (@guido07111975)

    The Theme’s author told me to contact the plugin author

    I did not. You did open a topic (link) but closed it again with status “resolved”.

    The snippet from bcworkz works like a charm, please add this in file function of your (child) theme or via the Code Snippets plugin.

    Thanks @bcworkz !

    Guido

    Thread Starter Muirén NíSídach

    (@rhomani)

    Sorry, my misunderstanding @guido07111975

    Thread Starter Muirén NíSídach

    (@rhomani)

    That code snippet works perfectly but I am not sure how to correctly add the original formatting.

    {margin:0 0 20px; padding:2px 0; border-top:1px solid #ccc; border-bottom:1px solid #ccc; text-align:left; text-transform: capitalize; font-weight: 700; font-size: 28px; color:#5C6A78;}

    Into

    add_filter('gettext', function( $translation, $text, $domain ) {
      if ( $text == 'Featured post') $translation = 'About . . .';
      return $translation;
    }, 10, 3 );
    Guido

    (@guido07111975)

    You can add that as custom CSS:

    
    .sticky-title {your CSS here}
    

    Guido

    Thread Starter Muirén NíSídach

    (@rhomani)

    It worded. Thank you.
    Weird, when I tried that earlier with the snippet of code, it changed the name like I wanted, but lost the custom CSS formatting. Now it looks perfect. Sorry to be so much trouble, and again, thanks @guido07111975 and @bcworkz

    Guido

    (@guido07111975)

    You’re welcome!

    Guido

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How to changing the display name “Featured Post”?’ is closed to new replies.