Remove dash from blog title wordpress

This is not quite trivial in general case, since it varies depending on title implementation by specific theme. The historical way has been wp_title() call in theme’s template. The newer method is hook–based Title Tag. So it is hard to say specifically without knowing/seeing code of a specific theme. This is one of the reasons … Read more

disallow publish posts with special title

The “easy” answer is: put a filter on it. add_action( ‘transition_post_status’, ‘my_function’, 10, 3 ); function my_function( $new_status, $old_status, $post ) { if ( ‘publish’ !== $new_status or ‘publish’ === $old_status ) return; if ( ‘post’ !== $post->post_type ) return; // restrict the filter to a specific post type $title = $post->post_title; $restricted_title = “title … Read more

post_exists returning 0 if title contain special characters

Looks like WP is using HTML entity encoding on the special characters, you need to parse the title using the html_entity_decode() function like so. $title = html_entity_decode(get_the_title($result->post_id)); if ( 0 === post_exists( $title ) ) { $title=”Document Id: “.$result->post_id .’ (Deleted)’; } I am not sure if the post exists function decodes the characters but … Read more

How to solve the site tag being displayed twice?

You are getting the two <title> tags most likely because your theme has the title-tag support which automatically adds the title tags in the document head. Excerpt from the above linked page on Make WordPress Core: Adding titles to themes Starting with 4.1 and Twenty Fifteen, the recommended way for themes to display titles is … Read more

Title tags show twice

Go to the header.php file in your template folder and make sure that between the title tags, there’s only this code: <?php wp_title(”);?> That should do the trick. This error is a combination of your template files with standard settings of the Yoast SEO plugin.

Keep Title and Description always

In any properly coded theme the title should be completely generated with wp_title() and easily filterable to specific string (in functions.php or otherwise): add_filter( ‘wp_title’, function () { return get_bloginfo( ‘name’ ) . ‘ | ‘ . get_bloginfo( ‘description’ ); } );

Replace text in the Title

First things first, lets clean up your code: <?php $wptitle = the_title(); $wptitle = str_replace(‘&’, ‘and’, $wptitle);?><?php echo $wptitle; ?> Lets remove the PHP tag spam and put things in nice clean lines: <?php $wptitle = the_title(); $wptitle = str_replace(‘&’, ‘and’, $wptitle); echo $wptitle; ?> Now if we look at the problem, the_title, that function … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)