How do I set the blog name?
Go to admin dashboard > Settings > General You are getting General Settings…
Go to admin dashboard > Settings > General You are getting General Settings…
<?php if (is_home() || is_front_page()) { $header_tag = ‘h1’; } else { $header_tag = ‘h2’; } ?> <<?php echo $header_tag;?>><?php the_title();?></<?php echo $header_tag; ?>> Expanding on what Stephen Harris said, here is a useable example. Lots of different ways to use same code function.
the_title filter filters the existing title when it’s output on the front end. If you want to set a title when a post is created on the back end, you want to use the title_save_pre filter: function wpa65253_time_title( $title ) { global $post; if ( isset( $post->ID ) ) : if ( empty( $_POST[‘post_title’] ) … Read more
Steal the code from get_the_excerpt(): apply_filters( ‘get_the_excerpt’, $recent[‘post_excerpt’] )
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; }
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
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
You’ve tried correct filter – just needs to update return: function my_admin_title ( $admin_title, $title ) { return $title . ‘ ‹ ‘ . get_bloginfo( ‘name’ ) . ‘ — ‘ . ‘foobar’; } add_filter( ‘admin_title’, ‘my_admin_title’, 10, 2 ); Btw, filter above works only for logged pages, for login page needs to add another … Read more
I think the php you’ll need to put into your template is <?php the_title();?> and <?php the_excerpt();?> Wrapped up in whatever you are using to do the hover
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