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; }

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_page_by_title() not returning anything [closed]

You are missing the second parameter in get_page_by_title. See get_page_by_title() reference. When you are testing without explicitly specified $output and $post_type, this function returns the post of type ‘page’ object by default. So you have to return $page->post_parent for patient’s parent page ID: add_filter(‘gform_field_value_parent_id’, ‘parent_id’); function parent_id() { // three parameters here $page = get_page_by_title(‘TESTID’, … Read more