add_filter('wpseo_set_title', 'wpseo_set_title_callback');
function wpseo_set_title_callback($input) {
if (is_single()) {
return 'Now Single';
}
// return default
return $input;
}
Or example from wpSEO Hilfecenter:
add_action('init', 'wpseo_set_title');
function wpseo_set_title() {
add_filter(
'wpseo_set_title',
'wpseo_set_title_callback'
);
}
function wpseo_set_title_callback($input) {
if (is_single()) {
return 'Now Single';
}
// Else return default:
return 'Das Buch "'. $input . '" probelesen.';
}
Related Posts:
- Best way to programatically add “rel” attributes to page and post images
- Add caption functionality to custom WordPress theme
- get_terms (or tax_query) for term of current post?
- Best way to disable sidebars on posts (only)?
- Insert a field with PREG_REPLACE – strange behaviour
- I would like single.php to act just like index.php
- How to display different blocks for mobile and desktops
- Using AJAX on frontend: Synchronous XMLHttpRequest deprecation except for admin role
- Show stuff everywhere except single post?
- How to customize the_archive_title()?
- How to override parent functions in child themes?
- Solution to render Shortcodes in Admin Editor
- Define page template in wp_insert_post
- Get a list of all available fields in the User Profile
- How do I use the WP image functions in a page template?
- How to remove Customize from admin menu bar after WP 4.3
- Child theme functions.php do I use php open and close tags?
- Modify Admin Bar Link
- why doesnt is_home() work in functions.php
- WP 4.4. responsive loads normal image after loading the responsive image
- Insert Ad Code in the Middle of a Post
- Enabling shortcodes for custom fields
- Passing variables to templates (alternatives to globalizing variables)
- Load post with a different template?
- How can I tell if I’m on a login page? [duplicate]
- Add options to featured image
- Programmatically Add Font-Awesome Icons to Category Widget
- Dynamically Register Sidebars For Each Top Level Page
- Two different menus for two different locations?
- Error after editing functions.php
- Unregister Nav Menu with fallback?
- Changes to functions.php not working
- Insert width & height attributes to all images displayed on each page
- Custom excerpt legnths for specific pages
- Remove default user registration, login and subscriber profiles
- How to load some jquery code to make validation in the theme customizer?
- Include files in child themes, declare in functions.php
- Hook specific functions if on a specific admin page
- Display first name of logged in user?
- Identical custom taxonomy slugs for same hierarchical children
- How do I customize my wordpress Admin Area?
- User meta and author meta
- List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?
- Sorting table function default
- Custom Post excerpt not working correctly
- Custom Nav Walker sub-menu
- Wait a result before enqueue
- How do I remove the date and category form my portfolio pages
- Default Custom Field Value Automatically Update
- Get list of all custom tanonomy id
- Add button to kitchen sink toggle
- Get User Login Data (date, time… )
- Modify post filter to set custom number of posts per page and exclude child posts
- Remove “Published On” inside wp-admin
- Changing parent element’s class or style
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- User function to return multiple get_post_meta()
- How can i unload effect.min.js file?
- How can I pass a shortcode value to the head in wordpress functions.php
- Native gallery custom html output
- WordPress wraps span tags into p tags
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- why is this function firing on all child menu items as well?
- Custom styles in Tiny MCE with an external CSS file
- I changed Functions.php and now I get “cannot decode raw data NSURLErrorDomain:-1015” (not blank)
- How to add schema markup to WordPress menu function
- Use add_action within template
- Replace admin header logo with an image
- contact form in template with jquery,validate and ajax
- Changing the header image using WPML
- How to require a config file in a template and in function.php?
- Issue passing action class to nested function. Admin Columns
- Populate Product Regular Price with a calculated ACF Field Value
- Header menu aligned right on all pages except for single-post page [closed]
- How Do I Unhook This Parent Theme Function?
- How to make the RTL.css the dominant css code?
- How to create an array if ’empty’?
- Auto remove tags on certain date
- get_field() with ID in one signal filter not working
- i can’t use wordpress functions in ajax loaded php file
- Woocommerce – Switching Price for Category
- Remove External Links from WordPress posts Using add_filter() in Theme functions.php
- How to create a WordPress Customizer Button to Clear a Cache?
- Is there any requirements to do socket programming with WordPress?
- Adding A New Widget to WordPress Disables the Existing Widgets
- Slider Thumbnail Size Issue [closed]
- same get_posts function works diffrently in tag.php and functions.php
- Javascript and Stylesheet in child page
- Call custom field using php
- Problem in outputting shortcode
- Retrieve array of attachment IDs attached to a given Post ID
- add_theme_support not outputting thumbnails
- How to get tags and categories?
- Archive.php, and post_is_in_descendant_category
- update_user_option not working as expected
- Having problems loading Jquery in functions.php
- How do I access variables outside a function [closed]
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Retrieving next_post_link() and previous_post_link() in functions.php
- woocommerce_sort_product_tabs() expects an array