Problems with dynamic-cached-content
-
Hello, thanks for the plugin first of all.
I have some kind of troubles. I need that all my users are served cached pages for all of them, but I have some problems in the header, because there, is supposed to appear a menu that gives them access to their profile and a link for logout. With the option “Make known users anonymous so they’re served supercached static files.” I cannot used correctly the function is_user_logged_in. How I can do it?
This is my code.
#header.php
<!--mfunc lt_menu_superior() --> <?php lt_menu_superior() ?> <!--/mfunc-->
#functions.php
function lt_menu_superior() { //display the small submenu echo "<div class='sub_menu'>"; if (!is_user_logged_in()) : $args = array('theme_location'=>'header', 'fallback_cb' => '', 'container'=>'', 'echo' =>false); $nav = wp_nav_menu($args); echo $nav; echo '<ul class=\'sub-menu\'><li id=\'menu-item-description\'>'; echo bloginfo('description'); echo '</li>'; echo '</ul>'; endif; if (is_user_logged_in()) { $profile_url = bbp_get_user_profile_url( bbp_get_current_user_id() ); echo '<ul class=\'sub-menu\'><li id=\'menu-item-profile\'>'; echo '<a href=" ' . $profile_url . ' " >' . __('Your Profile', 'avia_framework') .'</a>'; echo '</li>'; if(defined('ICL_SITEPRESS_VERSION') && defined('ICL_LANGUAGE_CODE')) { echo '<li id=\'menu-item-logout\'>'; echo wp_loginout(icl_get_home_url()); echo '</li>'; } elseif (is_user_logged_in()){ echo '<li id=\'menu-item-logout\'>'; echo wp_loginout(site_url()); echo '</li>'; } //Enlace al if (current_user_can( 'administrator' ) ) { $admin_url = admin_url(); $edit_url = get_edit_post_link(); echo '<li id=\'menu-item-admin\'>'; echo '<a href=" ' . $admin_url . ' " target="_blank" >' . __('Admin', 'avia_framework') .'</a>'; echo '</li>'; echo '<li id=\'menu-item-edit\'>'; echo '<a href=" ' . $edit_url . ' " >' . __('Edit Post', 'avia_framework') .'</a>'; echo '</li>'; } echo '<li id=\'menu-item-description\'>'; echo bloginfo('description'); echo '</li>'; echo '</ul>'; } $phone = avia_get_option('phone'); $phone_class = !empty($nav) ? "with_nav" : ""; if($phone) echo "<div class='phone-info {$phone_class}'><span>{$phone}</span></div>"; /* * Hook that can be used for plugins and theme extensions (currently: the wpml language selector) */ do_action('avia_meta_header'); echo "</div>";
I’m using the option PHP to serve cache files and of course, dynamic caching is enable.
Thank you
- The topic ‘Problems with dynamic-cached-content’ is closed to new replies.