Set category page title in custom theme [closed]

In your functions.php of your theme file add the following code, taken from Remove “Category:”, “Tag:”, “Author:” from the_archive_title. add_filter( ‘get_the_archive_title’, function ($title) { if ( is_category() ) { //being a category your new title should go here $title = single_cat_title( ”, false ); } elseif ( is_tag() ) { $title = single_tag_title( ”, false … Read more

remove the title attribute from links [closed]

You could provide some more details, like what title attributes you are trying to remove. In the navigation, content, etc. Anyway, you could try adding this to your theme or child theme’s functions.php file, I have yet to test it though. function remove_title_attributes($input) { return preg_replace(‘/\s*title\s*=\s*([“\’]).*?\1/’, ”, $input); } add_filter(‘wp_list_pages’, ‘remove_title_attributes’);

How to put post title or keyphrase in content on different places automatically?

You can search-replace those placeholders with the_content filter. function custom_the_content( $content ) { return str_replace(‘{placeholder}’, get_the_title(), $content); } add_filter(‘the_content’, ‘custom_the_content’); Note: I don’t recommend using *** or similar as a placeholder, as it can be commonly used. That is why I’ve used {placeholder}. UPDATE: Based on the comments below, if you need to search-replace multiple … Read more

how can i remove page title on desktop view

Write the CSS into style.css file @media only screen and (min-width: 768px) { .single-product .title-desc { display: none; } } .single-product CSS will only work on single product details. It will not create any issue on other pages.

change title page on search result

To change document title use document_title_parts.filter. You want to apply changes only on the search page (as indicated in the title), so you should use is_search() conditional tag (or is_archive() as you suggest in the comment) and your code from php file. add_filter( ‘document_title_parts’, ‘se333744_site_title’ ); function se333744_site_title( $title ) { global $wp_query; if ( … Read more

Why in my query is display two title?

Try this. The code has comments where modified. <?php // args $args = array( ‘showposts’ => 5, ‘post_type’ => ‘post’, ‘orderby’ => ‘date’, // ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘type_id’, ‘value’ => ‘News’, ‘compare’ => ‘LIKE’ ), ) ); // query $the_query = new WP_Query( $args ); ?> … Read more

How to add publish date in the title

if the output you see is ABC [post_published], then it means your shortcode isn’t working as it should. try including following code at the end of inside your theme’s functions.php file. function ppd_shortcode(){ return get_the_date(); } add_shortcode(‘ppdate’, ‘ppd_shortcode’); When you register a shortcode using the add_shortcode function, you pass in the shortcode tag ($tag) and … Read more

Run a function on all posts

Rather than hooking into init or wp_load, here is a snippet you can drop into functions.php or on a theme file. I put it behind a $_GET so that you can only hit it once and when you are ready. Something like https://domain.com/page/?update_post_meta // Hide it from the public if(isset($_GET[‘update_post_meta’])){ // Let’s query all of … Read more

Yoast taking over my WordPress title tag [closed]

That’s not what the SEO title does/is for. It appears that you’ve used the wp_title() function in your template by mistake. wp_title() is intended for use in the <title> tag in the <head> for setting the browser tab/document title. However, since WordPress 4.1 this has been superseded (but not officially deprecated, yet) by add_theme_support( ‘title-tag’ … Read more

Change/Set Page Title and Meta Tags from Page Called within a Plugin

Attach to wp_head action hoook function that will display meta tag. Inside that function you can: add your own filter that will allow you to change the value, or change tag value depending of your query vars (sign1, sign2, …) or conditional tags. add_action( ‘wp_head’, ‘se344297_description_metatag_display’, 0 ); function se344297_description_metatag_display() { $site_descr = apply_filters( ‘description_tag_filter’, … Read more