Home Forums Plugin Support WP User Frontend Pro [wpuf_dashboard] not showing anything

This topic is: not resolved

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Dongsan 4 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19437

    Dongsan
    Member
    Post count: 6

    Hi there,

    I've purchased WP User Frontend Pro Version 2.1.9, and am using it in my localhost environment. Everything was going well until I tried to implement the dashboard page.

    Here's what I did.

    – Created a new page named User Dashboard
    – Inserted [wpuf_dashboard] on the page
    – Associated it with a template named User Dashboard.

    Page Screen

    Just in case it's relevant, here's what I have in the template.

    Template capture

    However, this User Dashboard page displays nothing.

    Actual Web Screen

    What is more strange, I can manually display the dashboard if I un-comment the codes.

    <?php while ( have_posts() ) : the_post(); ?>
    <?php the_content(); ?>
    <?php endwhile; ?>

    What am I missing here, and what should I do?

    Any help will be much appreciated.

    Thank you.

    #19441

    Dongsan
    Member
    Post count: 6

    I kinda figured out why it is not working: it seems that there are conflicts between qTranslate plugin and WP User Frontend plugin. With qTranslate activated, WPUF's dashboard is not shown. However, when I go de-activate qTranslate, WPUF's dashboard is properly displayed.

    Not sure how I may resolve this conflict…

    #19442

    Oritro Ahmed
    Spectator
    Post count: 155

    Well, Its never been reported before, The Conflict between qTranslator and WPUF. We have send the Details to our Developer team. They will take a Look on it.

    #19445

    Dongsan
    Member
    Post count: 6

    Here's my functions.php, just in case this is relevant.

    
    <?php
    
    /**
     * Disable the Admin Bar
     */
    remove_action( 'init', 'wp_admin_bar_init' );
    
    /**
     * Disable admin bar on the frontend of your website if not admin
     */
    function themeblvd_disable_admin_bar() { 
    	if( ! is_admin() )
    		add_filter('show_admin_bar', '__return_false');	
    }
    add_action( 'after_setup_theme', 'themeblvd_disable_admin_bar' );
     
    
    /**
     * Redirect back to homepage and not allow access to 
     * WP admin if not admin
     */
    function themeblvd_redirect_admin(){
    	if ( !is_admin() ){
    		wp_redirect( site_url() );
    		exit;		
    	}
    }
    add_action( 'admin_init', 'themeblvd_redirect_admin' );
    
    /**
     * add thumbnail support
     */
    add_theme_support( 'post-thumbnails' );
    // menus
    register_nav_menus( array( 'main_menu' => 'Main Menu',
    ));
    
    /**
     * add sidebar
     */
    register_sidebar( array( 
    'name' => __( 'Right Sidebar' ),
    'before_widget' => '<div class="jb-widget">',
    'after_widget' => '</div>',
    ));
    register_sidebar( array(
    'name' => __( 'Left sidebar' ),
    ));
    
    add_theme_support( 'post-formats', array( 'image', 'quote' ) );
    
    /**
     * remove update notice
     */
    add_action('admin_menu','wphidenag'); function wphidenag() { remove_action( 'admin_notices', 'update_nag', 3 ); }
    
    function init_jquery() { 
    if( !is_admin() ) { 
    wp_enqueue_script( 'jquery' ); 
    }
    }
    add_action( 'init', 'init_jquery' );
    
    /*
    // Match sub-categories and sub-templates
    function my_callback( $original_template ) {
      
    	if ( is_category() ) {
        
    		if ( is_category(get_cat_id('Announcement')) || is_category(get_cat_id('公告')) ) 
    			return get_stylesheet_directory(). '/category-notice.php';
    		elseif ( is_category(get_cat_id('Developer News')) || is_category(get_cat_id('开发者消息')) ) 
    			return get_stylesheet_directory(). '/category-developer_news.php'; else
    		return $original_template;
     
    	}	
    	
    	if ( is_single() ) {
    
    		if ( in_category('Announcement') || in_category('公告') )
    			return get_stylesheet_directory(). '/single-notice.php';
    		elseif ( in_category('Developer News') || in_category('开发者消息') )
    			return get_stylesheet_directory(). '/single-developer_news.php';
    		else return $original_template;
    
        }
    
    	if ( is_page() ) return $original_template;
    }
    add_filter( 'template_include', 'my_callback' );
    */
    
    /**
     * make sub-categories use parent category's template based on SLUG
     */
    function inherit_template() {
      
      $templatepath = get_stylesheet_directory();
    
      if (is_category()) {
        $cat_id = get_query_var('cat');
        $cat_array = get_category($cat_id);
        $cat_slug = $cat_array->slug;
    	   
    	if ( file_exists($templatepath . '/category-' . $cat_slug . '.php') ) {
          include( $templatepath . '/category-' . $cat_slug . '.php');
          exit;
        }
    
        $parent_cat_id = $cat_array->category_parent;
        
    	while( $parent_cat_id ) {
          
    	  $parent_cat_array = get_category( $parent_cat_id );
    	  $parent_cat_slug = $parent_cat_array->slug;
          
    	  if ( file_exists($templatepath . '/category-' . $parent_cat_slug . '.php') ) {
            include ($templatepath . '/category-' . $parent_cat_slug . '.php');
    		echo "template found : ".$templatepath . '/category-' . $parent_cat_slug . '.php';
            exit;
          }
    	  
    	 // echo "template NOT found<br/>";
    	 // echo "TEMPLATE PATH = ".$templatepath."<br/>";
    	 // echo "SLUG = ".$parent_cat_slug."<br/>";
    	 // echo "TEMPLATEPATH + SLUG = ".$templatepath . '/category-' . $parent_cat_slug . '.php'."<br/>";
    
          $parent_cat_id = $parent_cat_array->category_parent;
        }
      }
    }
    add_action('template_redirect', 'inherit_template', 1);
    
    /**
     * Use Parent Single's Template for Child Singles
     */
    function my_single_template($single) {						// Single template function which will choose our template
    	
    	global $wp_query, $post;
    	$templatepath = get_stylesheet_directory();
    
    	// Checks for single template by category slug
    	foreach( (array)get_the_category() as $cat ) :
    
    		if( file_exists( $templatepath . '/single-' . $cat->slug . '.php' ) ) {
    			return $templatepath . '/single-' . $cat->slug . '.php';
    		}
    
    		$parent_cat_id = $cat->category_parent;
    
    		while( $parent_cat_id ) {
    			$parent_cat_array = get_category( $parent_cat_id );
    			$parent_cat_slug = $parent_cat_array->slug;
    		
    			if ( file_exists($templatepath . '/single-' . $parent_cat_slug . '.php') ) {
    				return $templatepath . '/single-' . $parent_cat_slug . '.php';
    			}
    
    			$parent_cat_id = $parent_cat_array->category_parent;
    		}
    
    	endforeach;
    
    	// if not returned yet until this point (meaning that none of above are processed), return the original template
    	return $single;
    
    }
    add_filter('single_template', 'my_single_template');		// Filter the single_template with our custom function
    
    /**
     * Re-style wordpress default css
     */
    function my_login_stylesheet() { ?>
        <link rel="stylesheet" id="custom_wp_admin_css"  href="<?php echo get_bloginfo( 'stylesheet_directory' ) . '/css/custom-wp-admin-style.css'; ?>" type="text/css" media="all" />
    <?php }
    add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );
    
    /**
     * hook login error to stay on the same page if the user entered wrong login info
     */
    add_action( 'wp_login_failed', 'custom_login_failed' );
    function custom_login_failed( $username )
    {
        $referrer = wp_get_referer();
        if ( $referrer && ! strstr($referrer, 'wp-login') && ! strstr($referrer,'wp-admin') )
        {
            wp_redirect( add_query_arg('login', 'failed', $referrer) );
            exit;
        }
    }
    
    /**
     * hook login error to stay on the same page even if the user inputted nothing
     */
    add_filter( 'authenticate', 'custom_authenticate_username_password', 30, 3);
    function custom_authenticate_username_password( $user, $username, $password )
    {
        if ( is_a($user, 'WP_User') ) { return $user; }
        if ( empty($username) || empty($password) )
        {
            $error = new WP_Error();
            $user  = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
            return $error;
        }
    }
    
    /**
     * allow users to login with email address
     */
    function login_with_email_address($username) {
    	$user = get_user_by_email($username);
    	if(!empty($user->user_login))
    		$username = $user->user_login;
    	return $username;
    }
    add_action('wp_authenticate','login_with_email_address');
    
    /**
     * auto log in a user who has just signed up     
     */  
    function wpufe_auto_login_new_user( $user_id ) {
        wp_set_current_user( $user_id );
        wp_set_auth_cookie( $user_id, false, is_ssl() );
    
    }
    add_action( 'user_register', 'wpufe_auto_login_new_user' );
    
    /**
     * A function used to programmatically create a post in WordPress. The slug, author ID, and title
     * are defined within the context of the function.
     */
    function programmatically_create_post() {
    
    	// Initialize the post ID to -1. This indicates no action has been taken.
    	$post_id = -1;
    
    	// Setup the author, slug, and title for the post
    	$current_user = wp_get_current_user();
    	$title		= $current_user->user_login;
    	$slug		= $current_user->user_login;
    	$author_id	= $current_user->ID;
    
    	$output = "OBJECT";
    	$post_type = "home_per_developer";
    
    	$cat_id = 10; // category id for developer home
    
    	// If the page doesn't already exist, then create it
    	if( null == get_page_by_title( $title, $output, $post_type ) ) {
    		
    		// Set the post ID so that we know the post was created sucessfully
    		$post_id = wp_insert_post(
    			array(
    				'post_author'		=>	$author_id,
    				'post_name'			=>	$slug,
    				'post_title'		=>	$title,
    				'post_status'		=>	'publish',
    				'post_type'			=>	$post_type,
    				'post_category'		=>	array( $cat_id )
    			)
    		);
    	} else {
    		// The page exists and we'll stop
    		// Arbitrarily use -2 to indicate that the page with the title already exists
    		$post_id = -2;
    
    	}	// end if
    
    } // end programmatically_create_post
    add_filter( 'user_register', 'programmatically_create_post' );
    
    // add breadcrumb
    function the_breadcrumb() {
    	global $post;
    	if( qtrans_getLanguage() == 'en' ) $msg = 'You are now ';
    	if( qtrans_getLanguage() == 'zh' ) $msg = '你目前在 ';
        echo '<ul id="breadcrumbs">';
        if (!is_home()) {
    		echo '<li>●</li>';
    		echo '<li>'.$msg.'</li>';
    		echo '<li>@</li>';
            echo '<li><a href="';
            echo get_option('home');
            echo '">';
            echo 'Home';
            echo '</a></li><li class="separator"> / </li>';
            if (is_category() || is_single()) {
                echo '<li>';
                the_category(' </li><li class="separator"> / </li><li> ');
                if (is_single()) {
                    echo '</li><li class="separator"> / </li><li>';
                    the_title();
                    echo '</li>';
                }
            } elseif (is_page()) {
                if($post->post_parent){
    				$anc = get_post_ancestors( $post->ID );
    				$title = get_the_title();
    				foreach ( $anc as $ancestor ) {
    					$output = '<li><a href="'.get_permalink($ancestor).'" title="'.get_the_title($ancestor).'">'.get_the_title($ancestor).'</a></li> <li class="separator">/</li>';
    				}
    				echo $output;
    				echo '<strong title="'.$title.'"> '.$title.'</strong>';
    			} else {
    				echo '<li><strong> '.get_the_title().'</strong></li>';
    			}
            }
        }
        elseif (is_tag()) {single_tag_title();}
        elseif (is_day()) {echo"<li>Archive for "; the_time('F jS, Y'); echo'</li>';}
        elseif (is_month()) {echo"<li>Archive for "; the_time('F, Y'); echo'</li>';}
        elseif (is_year()) {echo"<li>Archive for "; the_time('Y'); echo'</li>';}
        elseif (is_author()) {echo"<li>Author Archive"; echo'</li>';}
        elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo "<li>Blog Archives"; echo'</li>';}
        elseif (is_search()) {echo"<li>Search Results"; echo'</li>';}
        echo '</ul>';
    }
    
    ?>
    
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘[wpuf_dashboard] not showing anything’ is closed to new replies.