How to Implement Category.php page title in wordpress custom template?

Your code is fine, the only problem here is a syntax error. Always remember to remove any spaces between the opening and closing tags – otherwise your code will fail. Example: <h2> <a href=”#” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”> <?php the_title(); ?> </a> </h2> Make sure to read the WordPress Codex about the_title_attribute() … Read more

Site name not showing in browser bar, only url

CSS will not influence it. Check your theme’s functions.php file (or similar) to see if it’s transforming the title. add_filter( ‘wp_title’, ‘some_function_name’ ); You can read more about it in the Codex: https://codex.wordpress.org/Function_Reference/wp_title#Customizing_with_the_filter

Hide title in Merlin Theme on posts and pages only

Your theme correctly uses the body_class function, which you can see by looking at the body tag. This means CSS classes are being added such as page or post that you can work with. e.g. body.page .entry-title { display: none; } There are many other CSS classes that may be useful to you, I suggest … Read more

How to auto update post title and slug with category name when post status is updated

You need post status transitions, and quite similar with this post: Detect type of post status transition only what you need to do update post title and slug, and this is easy. Update post examples Since you wrote like this: add_filter( ‘the_title’, ‘my_modify_title’, 10, 2 ); function my_modify_title( $title, $id ) { if( in_category( ‘My … Read more

How to modify title tag in a plugin?

What I actually ended up doing was to use filter document_title_parts. https://developer.wordpress.org/reference/hooks/document_title_parts/ I just unshifted a value to the array. I don’t think the documentation actually is very clear about that. And this method still don’t work with Yoast SEO installed.

How can I prevent the Search Results Page from changing title?

You can replace: <h1 class=”site-title”><?php echo get_the_title($post->ID); ?></h1> With: <h1 class=”site-title”><?php _e( ‘Search results for’, ‘theme-textdomain’ ).’: ‘ . get_search_query(); ?></h1> But obviously only in search pages. I suggest to move the <h1> element to each template you may need instead of include it in the general header.php template. It is up to you but … Read more

conditional widget title

Not a lot to go on here! I’d suggest registering 2 different sidebars – one for the category 3 posts and one for the rest. Then you can add you widgets and modify them as required.

Replace Underscore (_) on Space ( )

You are correct, you need to use str_replace. See details here So the correct code would be: $postData = array( ‘post_title’ => str_replace(‘_’, ‘ ‘, $attachment->post_title), ‘post_type’ => ‘post’, ‘post_content’ => $image_tag, ‘post_category’ => array(‘0’), ‘post_status’ => ‘publish’ );