From the Codex
If you are using a custom homepage with custom loops and stuff or a custom front-page, you will have an empty wp_title. Here goes a neat hack to add the description/tagline at the wp_title place on homepage:
add_filter( 'wp_title', 'baw_hack_wp_title_for_home' );
function baw_hack_wp_title_for_home( $title )
{
if( empty( $title ) && ( is_home() || is_front_page() ) ) {
return __( 'Home', 'theme_domain' ) . ' | ' . get_bloginfo( 'description' );
}
return $title;
}
Related Posts:
- Blank space at beginning of tag?
- Why do templates contain so many PHP tag pairs?
- What exactly does “Posts page” do in WordPress?
- An unwanted inline style is added to my body tag
- How to properly insert a link to a template in WordPress?
- Change title only in dynamic page
- Creating custom page template from existing PHP site
- What are the advantages/disadvantages of ways to use php template files?
- Allowing HTML elements in title widgets spacing problem
- WooCommerce – Print Processing orders [closed]
- Add Link to PHP message
- separate list of programs in html/javascript coming from php
- Remove span tags from WooCommerce Downloads page
- Help me I cannot link my font-awesome to my WordPress Theme. I have my font-awesome folder already in my project
- Drop down question
- How to enable HTML tags in category description without breaking the category page
- Time Stamp In A WordPress Post Title That Does Not Keep Refreshing
- How to use wp_ajax_set_post_thumbnail?
- WP Website is shown in HTML
- Passing a value from an input field to a php function in WordPress?
- How do I disable cache for a certain page?
- Use Search Term in html link and redirect
- Can’t display anything through homepage text editor
- Mysterious letters appearing at the top of a few pages
- Comparison operator != not working in field [closed]
- Current WordPress Page Title as Search Parameter into A Tag
- How to find and delete a menu item in php?
- If user has clicked link add class and store using PHP/WordPress
- How can I edit the final HTML structure of the whole web page
- My single.php page skips the first div tag
- Install functionality for push notifications but WP-Theme has oddly-named, hidden source files [closed]
- Custom woocommerce payment gateway – Form
- Converting Array to String Issue [closed]
- opens like sitename.com/URL
- AJAX and custom pages
- ACF – Custom image for Product Tags not displaying
- WordPress Slider is not working
- Polylang and template files
- Roots Sage Symfony error when using override from template
- Problem with my Login Plugin
- How to return html as a string from php for WordPress
- How can I get the custom post title?
- How to display post meta bellow every posts
- HTML Formatting “single_term_title()”?
- how to add functions to my function.php using a child theme?
- How to Protect a private folder inside uploads folder, if User is not Logged In?
- Show subcategory name selected in specific category woocoommerce
- Make a full-width wordpress page
- How to center all text body in single.php at once?
- How can I create a shortcode from an html and php code written together
- Display child-page links in sidebar on both Parent Pages AND Child Pages
- sessionStorage saves input value in browser but it is not loaded in the form field
- Collapsible menu on post sidebar only expands and does not collapse
- Site title not showing. Please help me
- Unable to insert current username into custom table through html form
- How to create dynamic templates?
- If is_page elseif is_page not working like I want it to
- Change WooCommerce template for PDF – access to custom field
- How to display custom seo title before the loop?
- Changable favicon
- How can I get my pagination loop to display the correct number of total pages?
- Woocommerce custom attributes list help
- WooCommerce multiple custom fields code
- How to display last whole post on the homepage
- How to override html codes in wordpress?
- Access certain Entry in HTML-Table and pass the entry-data in WP not working [closed]
- missing admin bar and widget in a template
- How to include a function in a template with template tag
- AMP version of e-commerce without plugin
- Put a span class in the shortened product title
- Target a specific container to style on WordPress storefront theme
- Switch position of elements in the footer [closed]
- Add Text Area To Child Theme’s Home Page
- How to include different html tags in the header for different pages?
- Use PHP to inject HTML into before page renders?
- What syntax is this? “{{post.price}}”
- Create html tree sitemap
- wordpress form action page not found
- How to make a parent page for author.php?
- Creating Log-In Page for backend server
- Can’t get_users info by using json_encode
- user update profile for custom code
- scroll scrpit to particular button position to next id when click button
- My own theme’s custom widget areas are not working
- Vertical Menu for one page only
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Multisite – Display different header content based on which site is accessed
- Splitting table data to pages with numbers
- Show post/page into div using function
- wordpress, Category ID
- How do I modify the Previous and Next Page posts on blog pages to include “previous” and “next” before the links?
- Pass form attributes to another php template in wordpress
- Custom HTML form using PHP – help with ajax/username validation
- “Page Array” displaying in title bar on Front Page
- Code works on page-example.php by not category-example.php
- html to posts, jpg to featured image, zip file contains jpg and html
- how to remove replicating a tag inside loop?
- How to create a php page to collect information from a html page
- How do you change the tag font size in the repeater-template.php [closed]
- PHP tag in post content makes wordpress go crazy