WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
dynamic-cached-content and native wp functions (4 posts)

  1. andreausu
    Member
    Posted 3 years ago #

    Hi! I'm having troubles with dynamic-cached-content and some wp native functions such as comments_popup_link() edit_post_link() and comments_template(). No problems with plugins functions instead.
    I'm sure the syntax is correct because with plugin functions it works, the problem is with wp native functions: the first time (when aren't cached) they run fine, but the next time they just don't work (no errors even in debug mode, no value is returned by the function though).

    Example (this works):

    <!--dynamic-cached-content--><?php
    sidebarlogin();
    ?><!--
    sidebarlogin();
    --><!--/dynamic-cached-content-->

    Example (this doesn't work):

    <!--dynamic-cached-content--><?php
    edit_post_link( __( 'Edit entry'), '');
    ?><!--
    edit_post_link( __( 'Edit entry'), '');
    --><!--/dynamic-cached-content-->

    Thank you in advance!

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    Unfortunately those functions only run "in the loop". When a cached page is displayed the loop code isn't executed so those functions don't work.

  3. andreausu
    Member
    Posted 3 years ago #

    Thanks for the reply!
    So no workaround at all for this? :(
    Is it be possible to use ajax to run those functions dynamically or the outcome would be the same?

  4. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    There is, you recreate the edit links and show them to visitors with the right cookie. You just can't use the edit_post-link() command.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic