Site logo

Archived topic

generate_after_slideout_navigation problem! (Help)

19 replies · Started by johnaps on October 9, 2022

Viewing posts 16–20 of 20

Another thing i can try but idk if it is bad code-wise is this

add_action('generate_after_slideout_navigation', 'end_custom_inside_navigation_html_element');
add_action('generate_after_slideout_navigation', 'after_end_custom_inside_navigation_html_element', 11);
function end_custom_inside_navigation_html_element() {
	echo '</div>';
}
function after_end_custom_inside_navigation_html_element () {
	if (is_product_category() || is_product_tag() || is_product_brand() || is_search()) {
		$closebutton = do_shortcode('[facetwp facet="result_count"]');
		echo '<aside id="custom_html-65" class="widget_text slideout-widget widget_custom_html"><div class="textwidget custom-html-widget"><div class="slider-exit"><a href="#">' . $closebutton . '</a></div></div></aside>';
	}
}

This indeed puts a custom end

for div.inside-navigation.grid-container.grid-parent element and thus making my custom_html-65 be actually after div.inside-navigation.grid-container.grid-parent
but i dont know if this is ok cause it supposedly there should be an extra

hanging around which isnt visible...
You can look here at this solution (bellow 1014px media screen width)
https://testsofi4nos0rth0new.kinsta.cloud/%CE%BF%CE%BE%CF%85%CE%B3%CE%BF%CE%BD%CE%BF%CE%B8%CE%B5%CF%81%CE%B1%CF%80%CE%B5%CE%AF%CE%B1/

I see. Code-wise, there should be a hanging </div> though because you added a </div>.

How about changing this code:

echo '<aside id="custom_html-65" class="widget_text slideout-widget widget_custom_html"><div class="textwidget custom-html-widget"><div class="slider-exit"><a href="#">' . $closebutton . '</a></div></div></aside>';

to add

at the start to test?:

echo '<div><aside id="custom_html-65" class="widget_text slideout-widget widget_custom_html"><div class="textwidget custom-html-widget"><div class="slider-exit"><a href="#">' . $closebutton . '</a></div></div></aside>';

Does it still work?

Even if i add it at the start, the same behavior happens cause it will still be inside div.inside-navigation.grid-container.grid-parent...

Can you point me where can i find the template for #generate-slideout-menu so i can edit it, if thats the only way?
Also can you verify if i only need to copy the file to my child theme to edit it?
Lastly in case of an update of that template file does gp provide any kind of notice inside wp-admin so i know i need to update it in the future (as woocommerce does?)?

It shouldn't be inside div.inside-navigation.grid-container.grid-parent...

The

before <aside> will just turn the structure to <div class="inside-navigation grid-container grid-parent">...</div><div><aside id="custom_html-65"...>...</aside></div> - it should still be outside. It just closes the hanging </div>

You can't edit #generate-slideout-menu. It's part of the plugin, not the theme. I think your solution should be good though.

This archived topic is closed to new replies.