Results 1 to 1 of 1

Thread: Cartpauj PM New Message counter in header....

  1. #1
    Thread Starter
    Expired Customer maltacode's Avatar
    Join Date
    Mar 2015
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cartpauj PM New Message counter in header....

    I know I'm almost there, this is my code in classipress-child theme functions.php;

    Code:
    // add pm count to the Classipress header
    function pm_toolbar_link($cp_header) { 
        			global $cartpaujPMS;
    				$URL = get_permalink($cartpaujPMS->getPageID());
    				$numNew = $cartpaujPMS->getNewMsgs();								
    	 $args = array(
    		'id' => 'pm',
    		'title' => ''. __("You have", "cartpaujpm").' (<span style="color: red;"> ' . $numNew . ' </span>) '.__("new messages", "cartpaujpm").'', 
    		'href' => '' . $URL . '', 
    		'meta' => array(
    			'class' => 'pm', 
    			'title' => '' . $URL . ''
    			)
    	);
    	$cp_header->add_node($args);
    }
    add_action('appthemes_header', 'pm_toolbar_link');
    and this is my header part, I want the area where "Messaging" is to show the new message count created by the pm_toolbar_link() function...

    Code:
    // display the login message in the header 
    if (!function_exists('cp_login_head')) { 
        function cp_login_head() { 
            if (is_user_logged_in()) : 
                global $current_user, $facebook; 
                $current_user = wp_get_current_user(); 
                if ( 'fb-' == substr( $current_user->user_login, 0, 3 ) ) { 
            $display_user_name = $current_user->display_name; 
                } else { 
            $display_user_name = $current_user->user_login; 
          } 
                $logout_url = cp_logout_url(); 
                ?> 
                <?php _e('Welcome,','appthemes'); ?> <strong><?php echo $display_user_name; ?></strong> [ <a href="<?php echo CP_DASHBOARD_URL ?>"><?php _e('My Dashboard','appthemes'); ?></a> | <a href="http://monti.com.mt/message/"><?php _e('Messaging','appthemes'); ?></a> | <a href="<?php echo $logout_url; ?>"><?php _e('Log out','appthemes'); ?></a> ]&nbsp; 
            <?php else : ?> 
                <?php _e('Welcome,','appthemes'); ?> <strong><?php _e('visitor!','appthemes'); ?></strong> [ <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=register"><?php _e('Register','appthemes'); ?></a> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php"><?php _e('Login','appthemes'); ?></a> ]&nbsp; 
            <?php endif; 
    
        } 
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Dimitris Error message appearing in coloured strip above header menu
    By pjreynolds in forum Report Vantage Bugs (Legacy)
    Replies: 25
    Last Post: August 2nd, 2016, 10:31 AM
  2. Replies: 5
    Last Post: April 25th, 2015, 11:02 AM
  3. counter ad
    By ytsejam in forum Report ClassiPress Bugs
    Replies: 17
    Last Post: August 14th, 2014, 01:48 AM
  4. [SOLVED] Error message on social media links on my classipress header
    By hectorboss in forum Report ClassiPress Bugs
    Replies: 7
    Last Post: July 28th, 2014, 06:16 AM
  5. Samcy max file upload size message inaccurate, and error message inaccurate
    By almightyeric in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: January 15th, 2014, 09:09 AM