Remove site name from tag

The best (and easiest) thing to do is to use the wp_title filter. First, clean up your call to <?php wp_title(); ?> in your template. Replace what you have with this: wp_title( ‘&#124;’, true, ‘right’ ); Then, in functions.php (or in a child Theme functions.php; normal caveats apply), add the following: function wpse95147_filter_wp_title( $title ) … Read more

Site title not showing. What can I do?

Add this code to your functions.php if ( !function_exists( ‘yourtheme_setup’ ) ) { function yourtheme_setup() { /* * Let WordPress manage the document title. * By adding theme support, we declare that this theme does not use a * hard-coded <title> tag in the document head, and expect WordPress to * provide it for us. … Read more

Custom Post Type Title Placeholder [duplicate]

Yes sure you can achive that simply using enter_title_here filter hook. add_filter(‘enter_title_here’, ‘my_title_place_holder’ , 20 , 2 ); function my_title_place_holder($title , $post){ if( $post->post_type == ‘portfolio’ ){ $my_title = “Add new Portfolio”; return $my_title; } return $title; }

How can i remove JUST the title tag from wp_head() function?

You can see everything added to wp_head in the file /wp-includes/default-filters.php. If your theme supports the title tag, you can remove it entirely with remove_action: remove_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 ); Though it may be simpler/better to use remove_theme_support( ‘title-tag’ ) in a child theme, which is what _wp_render_title_tag checks before outputting the title tag.

Get wp_title() from page ID into a variable

As you said, wp_title works only for current post, so can be a little tricky save it in a variable for a post that is not the current. However, wp_title works not only for singular post / page / cpt but also for every type of archive. So it’s easy create a custom function that … Read more

Automatically add title attribute to links in WordPress

Don’t know if this works but it should, function get_page_title($url){ if( !class_exists( ‘WP_Http’ ) ) include_once( ABSPATH . WPINC. ‘/class-http.php’ ); $request = new WP_Http; $result = $request->request( $url ); if( is_wp_error( $result ) ) return false; if( preg_match(“#<title>(.+)<\/title>#iU”, $result, $t)) { return trim($t[1]); } else { return false; } } add_filter(‘the_content’,’auto_add_title_to_link’); function auto_add_title_to_link($content){ $html … Read more

Include category title in wp_title

Create a helper function to get all parent categories (each post can be in multiple categories): function parent_cat_names( $sep = ‘|’ ) { if ( ! is_single() or array() === $categories = get_the_category() ) return ”; $parents = array (); foreach ( $categories as $category ) { $parent = end( get_ancestors( $category->term_id, ‘category’ ) ); … Read more

Change Default Custom Fields Metabox Name

You need to declare the $wp_meta_boxes array as global: global $wp_meta_boxes; If it still doesn’t work try: add_filter(‘add_meta_boxes’, ‘change_meta_box_titles’); function change_meta_box_titles() { global $wp_meta_boxes; echo ‘<pre>’; print_r($wp_meta_boxes); echo ‘</pre>’; } to see what’s going on (and to check where the title is). You should also prefix your function names to prevent a clash with WP … Read more

How do I edit the tag without using the deprecated `wp_title()` function?

It looks like _wp_render_title_tag() method is what outputs the tag, and the source code in 4.8 is available here: https://core.trac.wordpress.org/browser/tags/4.8/src/wp-includes/general-template.php#L1083 You can see: echo ‘<title>’ . wp_get_document_title() . ‘</title>’ . “\n”; You could first remove the action from wp_head: remove_action( ‘wp_head’, ‘_wp_render_title_tag’, 1 ); Then add your own title render method: add_action( ‘wp_head’, ‘_wp_render_title_tag_itemprop’, 1 … Read more

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