How to modify a title tag in genesis?

Try this to create your custom titles. remove_filter( ‘wp_title’, ‘genesis_default_title’, 10, 3 ); //Default title remove_action( ‘genesis_site_title’, ‘genesis_seo_site_title’ ); //Genesis Extra Stuff remove_action( ‘genesis_site_description’, ‘genesis_seo_site_description’ ); //Genesis Extra Stuff add_filter( ‘wp_title’, ‘genesis_default_title_new’, 10, 3 ); function genesis_default_title_new( $title) { $title=”Hello World!”; return $title; }

Change all Post titles into [Title Case] format

EDIT: WP Title Hook Ok, so if you’re using wp_title (which you probably are, it’s default) that function should have two filters in it you could use. The first one is wp_title_parts, which returns your title broken up into an array. function wp_title_capitalize( $title_parts ) { // Only uppercases the words of the first element … Read more

Wrap h1-h6 in a div

Try this code function wrap_heading_with_div( $content ) { $heading = ‘/<h\d.*?>(.*?)<\/h\d>/ims’; $wrapper=”<div class=”title”>$0</div>”; $content = preg_replace($heading, $wrapper, $content); return $content; } add_filter( ‘the_content’, ‘wrap_heading_with_div’ ); Live Demo

Single_cat_title() print the title before text

Set the display argument of the function to false. <h2> <?php if (is_category()){ echo ‘Category: ‘ . single_cat_title( ”, false); } ?> </h2> Or, to use the function in its more “helpful” form you could do: single_cat_title(‘Category: ‘); If the display argument is true, WordPress automatically echoes the content on to the page usually within … Read more

get_page_by_title with an apostrophe in variable

Title Hello world!@#$%^*(),.;:\ will work but any title you enter containing ‘ ” < > & characters won’t work because in $content variable you have escaped HTML entities so Mal’s Post becomes Mal&#8217;s Post. To bypass it you can use sanitize_title function along with get_page_by_path. function shortcode_equipment($atts, $content = null) { $path = sanitize_title($content); $equipment … Read more

Hide price & title in store thumbnail dispay? [closed]

There are a couple solutions. The solution I would recommend is to remove the actions that prints the price & title in the first place. The main reason I suggest programmatically removing the actions is because it is theme independent. These modifications should work for any theme and you don’t have to worry about CSS … Read more

Remove site name from title post

Check your theme (header.php). If it uses something like this : <title><?php wp_title( ‘|’, true, ‘right’ ); ?></title> You can use this filter : add_filter( ‘wp_title’, ‘wpse104667_wp_title’ ); function wpse104667_wp_title( $title ) { global $post; if( is_singular() && !is_front_page() && !is_home() && !is_404() && !is_tag() ) $new_title = get_the_title($post->ID) ; return $new_title; } EDIT: add … Read more

How to limit characters of the post title?

You could do this : add_action(‘publish_post’, ‘wpse_107434_title_max_char’); function wpse_107434_title_max_char() { global $post; $title = $post->post_title; if (strlen($title) >= 100 ) wp_die( “the title must be 100 characters at most” ); } You can replace strlen() with str_word_count() if you want to set a word limit instead. EDIT: ok with new details you added it seems … Read more