elementor icon indicating copy to clipboard operation
elementor copied to clipboard

Include/Exclude Context toggle button in "Archive Title" module don't work as expected in search templates

Open fredoagency opened this issue 6 years ago • 25 comments

Hi! The toggle button for include/exclude "context" in the archive title module when using a condition for search templates in Theme Builder seems to be unset.

The problem seems to be inside the class Utils in file elementor-pro/classes/utils.php The if statement for is_search() inside the method: public static function get_page_title( $include_context = true ) missing an if statement for: if ( $include_context ){....}

fredoagency avatar Feb 05 '20 17:02 fredoagency

having the issue even on Page, Post, Archives, or WooCommerce Product. The checkbox doesn't hide the context

karimhossenbux avatar Nov 25 '20 11:11 karimhossenbux

having the issue even on Page, Post, Archives, or WooCommerce Product. The checkbox doesn't hide the context

Also having this issue on Elementor v3.0.16 and Elementor Pro v3.0.9

PedroTiagoSimao avatar Jan 07 '21 15:01 PedroTiagoSimao

Still having this issue, Elementor v3.1.1 and Elementor Pro v3.0.9

Toggling "Include Context" to "Off" has no effect, full archive and search context is displayed.

JasonBroderick avatar Feb 08 '21 13:02 JasonBroderick

Still existing bug

websplash avatar Mar 31 '21 08:03 websplash

Come one Elementor! FIX THESE TINY ISSUES WHICH MAKE YOUR CUSTOMERS LIVES A PAIN IN THE ASS!!!!!

Still a bug in April 2021!

No doubt we'll get gradient buttons before this is fixed 👎

DigitalBerry avatar Apr 20 '21 13:04 DigitalBerry

Still having this issue, Elementor v3.2.1 and Elementor Pro v3.2.1 Toggling "Include Context" to "Off" has no effect, full archive and search context is displayed.

yanisdm avatar Apr 23 '21 13:04 yanisdm

My temporary solution, use a custom shortcode in the title.

/**
 * Custom title for Archives without prefix.
 */
add_shortcode('cm_single_term_title', 'fn_cm_single_term_title');

function fn_cm_single_term_title()
{
	if (is_category()) {
		$title = single_cat_title('', false);
	} elseif (is_tag()) {
		$title = single_tag_title('', false);
	} elseif (is_author()) {
		$title = '<span class="vcard">' . get_the_author() . '</span>';
	} elseif (is_year()) {
		$title  = get_the_date(_x('Y', 'yearly archives date format'));
	} elseif (is_month()) {
		$title  = get_the_date(_x('F Y', 'monthly archives date format'));
	} elseif (is_day()) {
		$title  = get_the_date(_x('F j, Y', 'daily archives date format'));
	} elseif (is_tax()) { //for custom post types
		$title = sprintf(__('%1$s'), single_term_title('', false));
	} elseif (is_post_type_archive()) {
		$title = post_type_archive_title('', false);
	} else {
		$title = get_the_archive_title();
	}
	return $title;
}

petermann avatar Jul 03 '21 00:07 petermann

Aug 2021, Elementor Pro Versión 3.3.5, The same problem!

alamaxjashek avatar Aug 20 '21 00:08 alamaxjashek

Hilarious.

It's September 2021 and still not fixed...

mapsmarketing avatar Sep 10 '21 04:09 mapsmarketing

+1 - Will this take as long as clickable columns ?

BrockwayProd avatar Nov 01 '21 00:11 BrockwayProd

Still a problem in 3.5.0. Please fix! I now use this quick fix to change/remove the text:

add_filter( 'elementor/utils/get_the_archive_title','archive_callback' );
function archive_callback( $title ) {
 if ( is_search() ) { 
   return '' . get_search_query() ; 
 } 
   return $title; 
}

nmrelations avatar Nov 10 '21 08:11 nmrelations

My temporary solution, use a custom shortcode in the title.

/**
 * Custom title for Archives without prefix.
 */
add_shortcode('cm_single_term_title', 'fn_cm_single_term_title');

function fn_cm_single_term_title()
{
	if (is_category()) {
		$title = single_cat_title('', false);
	} elseif (is_tag()) {
		$title = single_tag_title('', false);
	} elseif (is_author()) {
		$title = '<span class="vcard">' . get_the_author() . '</span>';
	} elseif (is_year()) {
		$title  = get_the_date(_x('Y', 'yearly archives date format'));
	} elseif (is_month()) {
		$title  = get_the_date(_x('F Y', 'monthly archives date format'));
	} elseif (is_day()) {
		$title  = get_the_date(_x('F j, Y', 'daily archives date format'));
	} elseif (is_tax()) { //for custom post types
		$title = sprintf(__('%1$s'), single_term_title('', false));
	} elseif (is_post_type_archive()) {
		$title = post_type_archive_title('', false);
	} else {
		$title = get_the_archive_title();
	}
	return $title;
}

Thanks!!! It works for me!

vincenzolopalo avatar May 25 '22 10:05 vincenzolopalo

Hello

Still having issues Elementor pro 3.7.2

/**
 * Custom title for Archives without prefix.
 */
add_shortcode('cm_single_term_title', 'fn_cm_single_term_title');

function fn_cm_single_term_title()
{
	if (is_category()) {
		$title = single_cat_title('', false);
	} elseif (is_tag()) {
		$title = single_tag_title('', false);
	} elseif (is_author()) {
		$title = '<span class="vcard">' . get_the_author() . '</span>';
	} elseif (is_year()) {
		$title  = get_the_date(_x('Y', 'yearly archives date format'));
	} elseif (is_month()) {
		$title  = get_the_date(_x('F Y', 'monthly archives date format'));
	} elseif (is_day()) {
		$title  = get_the_date(_x('F j, Y', 'daily archives date format'));
	} elseif (is_tax()) { //for custom post types
		$title = sprintf(__('%1$s'), single_term_title('', false));
	} elseif (is_post_type_archive()) {
		$title = post_type_archive_title('', false);
	} else {
		$title = get_the_archive_title();
	}
	return $title;
}

I copy paste this code in function.php`and then added a new shortcode widget called [cm_single_term_title] in my search result template page but it only display the word "Archive" on the reslut page.

Maybe i missed something ?

Agalaxie avatar Jun 30 '22 17:06 Agalaxie

Hello

Still having issues Elementor pro 3.7.2

/**
 * Custom title for Archives without prefix.
 */
add_shortcode('cm_single_term_title', 'fn_cm_single_term_title');

function fn_cm_single_term_title()
{
	if (is_category()) {
		$title = single_cat_title('', false);
	} elseif (is_tag()) {
		$title = single_tag_title('', false);
	} elseif (is_author()) {
		$title = '<span class="vcard">' . get_the_author() . '</span>';
	} elseif (is_year()) {
		$title  = get_the_date(_x('Y', 'yearly archives date format'));
	} elseif (is_month()) {
		$title  = get_the_date(_x('F Y', 'monthly archives date format'));
	} elseif (is_day()) {
		$title  = get_the_date(_x('F j, Y', 'daily archives date format'));
	} elseif (is_tax()) { //for custom post types
		$title = sprintf(__('%1$s'), single_term_title('', false));
	} elseif (is_post_type_archive()) {
		$title = post_type_archive_title('', false);
	} else {
		$title = get_the_archive_title();
	}
	return $title;
}

I copy paste this code in function.php`and then added a new shortcode widget called [cm_single_term_title] in my search result template page but it only display the word "Archive" on the reslut page.

Maybe i missed something ?

Hello,

This code was made for use in archives only.

petermann avatar Jun 30 '22 17:06 petermann

Same problem here too, this worked for me.

Still a problem in 3.5.0. Please fix! I now use this quick fix to change/remove the text:

add_filter( 'elementor/utils/get_the_archive_title','archive_callback' );
function archive_callback( $title ) {
 if ( is_search() ) { 
   return '' . get_search_query() ; 
 } 
   return $title; 
}

dygaomarques avatar Oct 20 '22 13:10 dygaomarques

Still a problem in 3.9.1. Almost THREE !! years after the initial bug report. @nicholaszein image image

puregraphx avatar Dec 19 '22 19:12 puregraphx

The issue still occurred in 3.12.2

haidinhtran avatar Apr 17 '23 13:04 haidinhtran

of course it is still a bug, it's only 3 years old.

puregraphx avatar Apr 17 '23 15:04 puregraphx

🎂🎂🎂

Some things deserve to be celebrated :p

BrockwayProd avatar Apr 17 '23 16:04 BrockwayProd

Still... not... working...

bdayelementor avatar May 12 '23 14:05 bdayelementor