Hi @laellou,
do you mean the “Me Connecter” that you have in the main navigation?
If you mean that link for me it’s strange that it was working before.
Are you sure it’s because of the update of Content No Cache, or because of the update of the WordPress core or another plugin?
That link would work if you can do shortcodes inside the navigation. As a default WordPress doesn’t do it, and in Content No Cache no version before had code to enable shortcodes in the navigation. At least, if I’m not missing something.
In any case, you can make it work by adding this code to the functions.php of your child theme, or to a functional plugin:
add_filter('wp_nav_menu_items', function( $items ){
$content_no_cache_id = 2837; // Replace this ID with the ID of your Content No Cache element.
$items = str_replace( '<a href="#">[content_no_cache', '[content_no_cache', $items );
$items = str_replace( ' id=' . esc_attr( $content_no_cache_id ) . ']</a>', ' id=' . esc_attr( $content_no_cache_id ) . ']', $items );
return do_shortcode( $items );
} );
Replace 2837 with the ID of your Content No Cache shortcode.
I hope it helps.
Have a great day!
Jose
I forgot. You need to put the shortcode in the Navigation Label, e.g. [content_no_cache id=2837], and the symbol # in the URL when you edit the menu item.
@laellou
Hi, yes I speak about this button, and yes I am certain, it was working, I have downgrade the plugin and evrything works fine, but it is broken if I update it.
The shortcode is directly use on the WordPress code of the header, I dont need to add another plugin or your piece of code with the version before the last version.
-
This reply was modified 2 years, 2 months ago by
laellou.