It seems that the way you attached your function to the document_title_parts
filter is wrong. As per WordPress documentation, document_title_parts
only accepts one parameters, array $title
. So it doesn’t make sense that when you have 2 parameters in your function.
I suggest you do something like this:
function custom_document_title( $title_parts ) {
// Here is where you need to get the $bb_job variable
$bb_job = null; // Change this to the way you use to obtain $bb_job
// If $bb_job is not empty, assign $bb_job -> job_title
if($bb_job && $bb_job->job_title){
$title_parts['title'] = $bb_job->job_title;
}
return $title_parts;
}
add_filter( 'document_title_parts', 'custom_document_title', 1000, 1 );
Related Posts:
- REQUIRED: The theme must not used the tags. | REQUIRED: The theme must not call to wp_title()
- How to set custom title of custom page template?
- Include category title in wp_title
- Get wp_title() from page ID into a variable
- How can i remove JUST the title tag from wp_head() function?
- Change all Post titles into [Title Case] format
- How to modify a title tag in genesis?
- How to Change The Title in WordPress For SEO
- change title separator
- Change page title dynamically before header is rendered
- Why is a category/ tag name prefixed to title of every page?
- Where does Yoast SEO plugin sets the site/page title?
- After I set the title, it over-wrote all the titles for the individual pages
- Replace text in the Title
- Title tags show twice
- How to solve the site tag being displayed twice?
- disallow publish posts with special title
- Need help with page title (Static front page)
- Title tag on home using front-page template not showing
- How to get page title () in a different order?
- Reorder title tag and description tag with wpseo_title and wpseo_metadesc
- What change does this code need to include title of parent?
- How to modify title tag in a plugin?
- Change Bookmark Name without Changing TITLE Tag [closed]
- Using php to overwrite or replace title tag, while using yoast [closed]
- Limit the word count in the post title
- Problem in wordpress with “-“
- order by second word in title?
- Modify page title format (when using title-tag)
- Fill post titles from post content?
- Display post title on individual image attachment page
- Automatically add title attribute to links in WordPress
- Custom Post Type Title Placeholder [duplicate]
- Site title not showing. What can I do?
- Change title tag dynamically or within plugin?
- Get title of page from URL
- How to Change Title Attribute to be different from Page title
- How to sanitize post title with commas
- How to echo a different title to the page if it’s opened on an android mobile phone
- Adding schema.org itemprop to WP4.1 Title Tag
- Remove post title
- Woocommerce: How to remove page title from storefront theme homepage
- How to Customize “WordPress > Error” Text in Titlebar?
- How to insert icon in site title
- How can I automatically insert the page content as the title?
- Changing title & add Breadcrumbs
- Sanitize the output of the_title() or the_title_attribute() to remove whitespace
- Blog Title not showing up on main Blog page
- For better digital journalism, how to store a second title and excerpt?
- Keep Title and Description always
- Automated Footer information
- Setting page title and keywords from PHP code
- Anyway to specify what should appear in in .php file?
- Theme support title tag – how to replace the default WP separator (with a filter)?
- Print post title with markup
- Homepage meta title and description not showing in search engines?
- How to remove Title and CSS styling of title from particular page
- Double bar “|” in title (By WP SEO Yoast?) [closed]
- Delete a repeated part of post title in WordPress
- How to add publish date in the title
- How to put post title or keyphrase in content on different places automatically?
- How to give titles to custom post type as “unique” incremental number?
- Front page displays different than all other pages?
- How to disable publish button if post title exists
- Change auto post title generation according to different post properties
- Array to modify post titles
- How do I remove ‘Home’ from homepage title?
- How to set “lang” attribute for post/page title?
- Inconsistent title for posts
- Title don’t function as link
- Enclose title within a div?
- Title how does page no work in Twenty Eleven
- Change post title but not in widgets/menu/etc
- how to change the title of tag page?
- how to add dynamic text before and after of post title
- Add text to the first “title”=>get_the_title($post->ID), and shorten
- Modify WordPress Page Title ()
- Post title not displaying as recorded in the wp_posts table
- long-title posts do not want published
- Please I want to prefix my WP posts title according to each category
- Page Title Dependant On Input?
- “Page Array” displaying in title bar on Front Page
- Blog Post Title apearing twice
- Setting Page Title Yoast
- How to Implement Category.php page title in wordpress custom template?
- Display tab title as ‘blog tagline | blog title’
- double page title [duplicate]
- Why I can not modify the appereance of my title web site in google? [closed]
- How to get the meta title of a page configured as blog (loop)
- Generate page title tag from the content of H1
- Append text after wordpress title
- What is the wordpress page title php code?
- How to add … after a particular word/character limit to the title
- Remove post title in catogory page
- reformat entry-title with two different styles
- Show page name in browser
- I have a problem with Home Page title
- Trying to get more space removed from my header
- how to put breadcrumb under Title [closed]
- How to fix special characters when the title or excerpt is shortened [closed]