• I just got the pro version of W3TC to be able to use fragment caching. I don’t know if I am missing something. So far:

    I have defined in wp-config.php: define( ‘W3TC_DYNAMIC_SECURITY’, ‘1234321’ );

    In the options from WP Admin I have set the page cache to Disk: Basic and I have also turned on late initialization under the Page Cache settings section. To be sure that it works, I have tried this and it works as expected (shows current time and doesn’t cache it, it changes when reloading the page):

    
    <!– 1234321 mfunc echo ‘This is my website cached’; –>
    echo ‘The time is ‘.date( ‘H:i:s’, time() );
    <!–/mfunc 1234321 –>
    

    Now the problem comes. In the top right corner of my webpage, if the user is logged in I show “Hello user” but if the user is not logged in I show “Sign up” and “Log In”. I would like to disable cache from those buttons (or even the whole navbar, I don’t know). This is the code of my navbar:

    
    <nav id="navigation" role="navigation" class="clearfix">
        <div class="shadow"></div>
        <?php if (class_exists('UserProfile')) : ?>
    	<?php $up = UserProfile::getInstance(); ?>
    	<ul id="user-menu" class="menu">
    	<?php if ($up->current_user->ID == 0) : ?>
    	  <li><a>signup_page) ?>">Sign Up</a></li>
    	  <li><a>profile_page) ?>">Log In</a></li>
            <?php else : ?>
    	  <li><a>profile_page) ?>">Hello, <?= $up->current_user_data->first_name ?></a></li>
    	<?php endif; ?>
    	<li class="logo_autobild"><a href="https://www.autobild.es/" target="_blank" rel="noopener noreferrer"><img />wp-content/themes/cocheando/img/autobild.png"></a></li>
     </ul>
    <?php endif; ?>
    </nav>
    

    How can I disable cache in this code (as it is HTML + PHP). I am completely lost, I just got the pro version to do this. Thank you in advance

    • This topic was modified 6 years, 8 months ago by dacevid.
    • This topic was modified 6 years, 8 months ago by Jan Dembowski. Reason: Fixed formatting

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I just got the pro version of W3TC

    I’m sorry but that means you cannot be helped here.

    For pro or commercial product support please contact the author directly on their site. This includes any pre-sales topics as well.

    As the author is aware, commercial products are not supported in these forums. I am sure they will have no problem supporting you there.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @gidomanders When someone writes that they are a W3TC customer, please send them to the author’s site for support.

    Customers may not be supported in these forums.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fragment caching with W3TC plugin’ is closed to new replies.