Changing Title Tag on Shop Archive Page (current solution reverting to Title of First Product in Loop)

Seems like the solution I was looking for was !in_the_loop() Full: add_filter( ‘the_title’, ‘custom_account_endpoint_titles’, 10, 2 ); function custom_account_endpoint_titles( $title ) { if (is_shop() && !in_the_loop() && ! is_admin() && ( ! defined( ‘DOING_AJAX’ ) || ! DOING_AJAX )) { return ‘Shop – Parure.co’; } } Note: the !is_admin and !DOING_AJAX functions are to prevent … Read more

Add text to the first “title”=>get_the_title($post->ID), and shorten

there are many ways to do this, but frankly, this is not a wordpress question it’s a php question. here is your code doing what you asked for $imageAttr = [ “class” => “alignnone size-medium”, “alt” => get_the_title(get_the_ID()), “title” => __(‘hi’, ‘theme-textdomain’) . ‘ ‘ . wp_trim_words(get_the_title(get_the_ID()), 2), ]; $variable = [] is just a … Read more

I want to add number after post tittle for each category

Here’s an untested edit of your code to use the post’s first category in the count: add_action(‘the_title’, ‘dk_auto_numbering’); function dk_auto_numbering($title) { $post_ID = get_the_ID(); $the_post = get_post($post_ID); $date = $the_post->post_date; $maintitle = $the_post->post_title; if ($maintitle == $title && $the_post->post_status == ‘publish’ && $the_post->post_type == ‘post’ && in_the_loop()) { $categories = get_the_category($post_ID); if (is_array($categories) && count($categories) … Read more

Posts title instead of Pages and Category titles – PHP WordPress

How about extending the if statement to include the pages you require? Your code would look something like this: <?php if( is_front_page() ) { ?> <div class=”bloc-header-home”> <span class=”decouvrez”>Découvrez</span> <h1>La chasse en licence</h1> <span class=”avantages”>La chasse est partie prenante de la gestion durable des forêts, car elle contribue à la conservation des écosystèmes forestiers et … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)