An extra ' is displayed in the title

I've found a string that's showing the posts title - blogname as title in the browser, but it's adding an extra ' This is the code I'm using: <title><?php wp_title(‘ | ‘, ‘echo’, ‘right’); ?> - <?php bloginfo(‘name’); ?></title> I can't see any extra ' so I don't know what's wrong.
Category: Web

change title separator

tell me how permanent the links to change the splitter from vertical to horizontal of the main page write website. | — http://joxi.ru/a2XlxQXcyeKPj2 The name of the site | short name The name of the site — short name
Category: Web

How to add first 3-4 post tags on WordPress Post Title

Is there any theme function code that put the first 3-4 post tags on WordPress Post Title. Let's assume I am creating a new article for my site and I added the below tags for my post My Post Title - Wishing You a Very Happy Birthday My Post tags - Balloon, Birthday, Wishes, Gift, Celebration, Party I want to put the first 4 tags to my post title whenever I publish or save draft the post. My title should …
Category: Web

Displaying Page Title on index.php

I have my posts page set as index.php, and on there I have my main heading (as I do on all pages). I'm having trouble displaying the page's heading however. The page is called 'Blog' in WordPress, and has been specified as the posts page. If I output the page heading with wp_title('');, I get the title of the page — 'Blog' — but with the site name after it (perhaps due to Yoast SEO plugin). If I use the_title() …
Category: Web

Why doesn't this function work when I know that the IP Address is "true"?

I am trying to append "DEV SRV:" to the page title (i.e. title tag) if the IP Address matches that of the dev server. I have tried this both in the functions.php file of my child theme and as a standalone plugin add_filter('wp_title', 'dev_srv_title'); function dev_srv_title($title) { $host = $_SERVER['SERVER_ADDR']; if ($host =='0.0.0.0') { return 'DEV SRV: '.$title; } return $title; }
Category: Web

Replace category titles

I want to display different titles in category archives than the category title. I have created a function with if statements for this purpose: function category_titles_change() { if (is_category('name1')) { ?> new title 1 <?php } elseif (is_category('name2')) { ?> new title 2 <?php } elseif (is_category('name3')) { ?> new title 3 <?php } } How can I use this to change the <title></title> shown in the <head></head> I have tried this: function head_category_titles_change() { if (is_category()) { ?> <title> …
Category: Web

Woocommerce: How to remove page title from storefront theme homepage

I have been searching online for this and everywhere I go it says to put the following into your functions.php function remove_title_from_home() { remove_action( 'storefront_homepage', 'storefront_homepage_header', 10 ); } add_action( 'woocommerce_show_page_title', 'remove_title_from_home' ); OR function remove_title_from_home() { if ( is_front_page() ) remove_action( 'storefront_page', 'storefront_page_header', 10 ); } add_action( 'woocommerce_show_page_title', 'remove_title_from_home' ); Just in case there is an update to the theme which will overwrite this as I am not using a child theme, I put them into a plugin file …
Category: Web

Wordpress Body Content How to add current page title automatically in different places?

I'm new to wordpress with very limited/low knowledge in coding, I'm trying to build a faq section for different pages, where I need to insert the page title, post date, author etc. in multiple places. I want this below the content in many pages, Eg. 1.How do i use (page title) A.Use this (page title) as instructed here (link) by (author) 2.Where do i buy (page title) A.Buy (page title) from here (link). How do I accomplish this? Is this …
Category: Web

Modify WordPress Page Title (<head></head>)

I'm trying to modify the WordPress page title. However I'm fairly new to WordPress functions, hooks (filters &amp; actions) and so on. What I could achieve is to change and modify WordPress titles in the &lt;body&gt;. I also was able to change to Page title (&lt;head&gt;), but not to modify it. E.g.: Original page title: My house is red Modified page title (| -&gt; is used for seperate examples): My house is green | My house is red and blue …
Category: Web

Title tag on home using front-page template not showing

Currently in header I have the following: &lt;title&gt; &lt;?php wp_title(' | ', true, 'right'); ?&gt; &lt;?php bloginfo('name'); ?&gt; &lt;/title&gt; I tried adding if statement like the following below that did not work it displayed as the following: Roots Restaurant Roots Restaurant &lt;?php if(is_front_page()) {bloginfo('name');}?&gt; It should display as Home | Roots Restaurant on Home page the title tag looks like the following - Roots Restaurant. So it is missing Home |
Category: Web

Trying to add some custom text into Wordpress Post title via function.php

I need to add a custom text in wordpress Post title dynamically which I'm trying to add via this code in function.php Following code is not working add_filter('the_title', 'new_title', 10, 2); function new_title($title, $id) { if('babysitters' == get_post_type($id)){ $exclusive = get_field('exclusive', $id); // pass the id into get_field $title = $title .', ' .$exclusive->y; } return $title; }
Category: Web

Theme support title tag - how to replace the default WP separator (with a filter)?

I'm developing a theme for Themeforest and one of their requirements is about the tag. Themeforest states their requirement as follows: The theme must let WordPress add and manage the title. This is done by adding add_theme_support( 'title-tag' ); to functions.php instead of using wp_title() in the document head. The current output is on the home page: 'Site title - Site tagline'. On other pages it is 'Post or page title - Site tagline'. The separator is '-'. Can anyone …
Category: Web

How to change the seperator in the title

Change title separator. I'm working with the underscores starter theme. I want to make a small change to the title. Change the separator from "Post title | site name" to "Post title - site name" The simple way of doing this was to put &lt;title&gt;&lt;?php wp_title('-', true, 'right' ); ?&gt;&lt;?php bloginfo( 'name' ); ?&gt;&lt;/title&gt; in the header. But now I read that with the introduction of add_theme_support( 'title-tag' ); one should not use the &lt;title&gt; markup in the header. So …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.