• Hello I used to use the content no cache plugin on my sso shortcode “my account” / “login” button, it worked very well until your last update, but since then it doesn’t work anymore, instead of displaying my sso login link, it displays an infinite loading wheel, this is not visible on the page because I added my sso shorcode directly so as not to block users, but the button is now cached so I can no longer disconnect once connected

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jose

    (@giuse)

    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

    Plugin Author Jose

    (@giuse)

    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

    Thread Starter laellou

    (@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 1 year, 2 months ago by laellou.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘No Cache on shortcode’ is closed to new replies.