What code do you use to generate the text to go into the HTML title tag?

Mine is: function getDocumentTitle($separator = ” « “){ $title = get_bloginfo(‘name’); $desc = get_bloginfo(‘description’); if(is_front_page() && is_home() && !empty($desc)){ $title .= $separator.$desc; }elseif(is_home() || is_singular()){ $id = $GLOBALS[‘wp_query’]->get_queried_object_id(); if($meta = get_post_meta($id, ‘title’, true)) $title .= $separator.$meta; $title .= (empty($meta) && is_front_page() && !empty($desc)) ? $separator.$desc : $separator.get_post_field(‘post_title’, $id); }elseif(is_archive()){ if(is_category() || is_tag() || is_tax()){ $term … Read more

Custom Post Types: Custom columns with Title submenu?

I had a similar situation and I based myself on </wp-admin/includes/class-wp-posts-list-table.php>:499 (function single_row {…case ‘title’) Copy the $actions creation block, and associated variables, (which looks something like this) to your manage_{post_type}_posts_custom_column action: $post = get_post( $post_id ); setup_postdata( $post ); $title = _draft_or_post_title(); $post_type_object = get_post_type_object( $post->post_type ); $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID ); $actions … Read more

SEO meta description and title tag Yoast SEO

Yoast uses wp_head hook to output the meta description tag. Make sure you have this line in your <head>: <?php wp_head(); ?> For title tag, you can simplify the code by using one function call: <?php wp_title( ‘|’, true, ‘right’ ); ?> The wp_title uses a filter (same name wp_title) to let users change the … Read more

posts order by title second word

The simplest method may be to just save titles as last name / first name, then they will naturally sort. You can then reverse the title when you output it in the template. Your attempt to modify the orderby query var is fundamentally flawed. Order is created by MySQL, which doesn’t understand PHP, and can’t … Read more

Yoast SEO breadcrumbs: how to create a filter that uses the url slug for breadcrumb titles

Yoast does have a filter for you to use. See here: https://gist.github.com/jmcclellan/b2d97ffee0e924e28fa1 I used this to add “parent” pages to custom post types. We wanted to use pages as our category landers w/ custom post types as children. Yoast would not output the parent page slug by default since there is technically no real relationship, … Read more

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

String replace WordPress Site Title

Method 1 You can do this using JavaScript. First, add an id for your h1 tag. I will use mobId here so your header tag will look like this: <h1 class=”site-title” id=”mobId”>My Site Title – Is Great</h1> Then replace the hyphen with your desired code: <script> var myStr = document.getElementById(“mobId”).innerHTML; var newStr = myStr.replace(“-“, “<span … 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; }

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