<span class="resolved" aria-label="Resolved" title="Topic is resolved."></span>User posted by

[ad_1]

Replies: 2

Hello

With this code I can change the names of registered advertisers, but not guest advertisers.

I would like the guest advertiser’s name to remain the original.

How to solve?

add_filter( "adverts_tpl_single_posted_by", function() {
	if( get_post( $post_id )->post_author > 0 ) {
  return '[publishpress_authors_box layout="inline" show_title="false"]';
    } else {
		
	return "<span style='color:red'> Guest <strong>%s</strong></span>";
        
    }
  
} );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer