Code Block changes

Home Forums Legacy Support Support queries How-to & Troubleshooting Code Block changes

Tagged: ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #382165
    Physiotutors
    Participant
    Hello we are multi-language localizing our LMS with easyling The front-end translation also picks up usernames and translates them. We have identified 2 codeblocks that would need a <span no-translate added to them. How and where can we achieve this for the following: <li><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/"><img src="https://study.physiotutors.com/wp-content/uploads/2021/06/PHY-avatar-1.png" width="460" height="460" alt="Profile picture of Balazs Benedek" /><span>Balazs Benedek</span></a></li> Please have the code block above changed as <span translate="no"> <li><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/"><img src="https://study.physiotutors.com/wp-content/uploads/2021/06/PHY-avatar-1.png" width="460" height="460" alt="Profile picture of Balazs Benedek" /><span translate="no">Balazs Benedek</span></a></li> And the other one:
    <ul>
    <li id="username"><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/">Balazs Benedek</a></li>
    <li><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/mycred-history"><strong>0.00</strong></a></li> <li><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/profile/" title="Ver perfil">Ver perfil</a></li>
    <li id="vbplogout"><a href="https://study.physiotutors.com/wp-login.php?action=logout&redirect_to=https%3A%2F%2Fstudy.physiotutors.com%2F&_wpnonce=2fc604afc2&redirect_to=https%3A%2F%2Fstudy.physiotutors.com" rel="nofollow" title="Cerrar la sesión"><i class="icon-close-off-2"></i> LOGOUT</a></li>
    </ul>
    change to:
    <ul>
    <li id="username" translate="no"><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/">Balazs Benedek</a></li>
    <li><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/mycred-history"><strong>0.00</strong></a></li> <li><a href="https://study.physiotutors.com/members/ba-l-azs-benedekgmail-com/profile/" title="Ver perfil">Ver perfil</a></li>
    <li id="vbplogout"><a href="https://study.physiotutors.com/wp-login.php?action=logout&redirect_to=https%3A%2F%2Fstudy.physiotutors.com%2F&_wpnonce=2fc604afc2&redirect_to=https%3A%2F%2Fstudy.physiotutors.com" rel="nofollow" title="Cerrar la sesión"><i class="icon-close-off-2"></i> LOGOUT</a></li>
    </ul>
    #382263
    Anshuman Sahu
    Keymaster
    and where exactly these html blocks are showing ?can you please share some screenshot and page url as well.
    #382299
    Physiotutors
    Participant
    It's part of the Buddypress card. Check study.physiotutors.com refer: https://prnt.sc/r7aFjH14UQQ8 Refer: https://prnt.sc/ahnJemkDubDh refer: https://prnt.sc/x08h1ZmbDWWx
    #382321
    Anshuman Sahu
    Keymaster
    Hi we checked this out you need to redefine the widget by adding this code in your wplms-customizer.php file in wplms customizer plugin :
    
    class vibe_bp_login extends WP_Widget {
    	
    	function __construct() {
    		$widget_ops = array( 'classname' => 'vibe-bp-login', 'description' => __( 'Vibe BuddyPress Login', 'vibe' ) );
    		parent::__construct( 'vibe_bp_login', __( 'Vibe BuddyPress Login Widget','vibe' ), $widget_ops);
    	}
    	
    	function widget( $args, $instance ) {
    		extract( $args );
    		
    		echo vibe_sanitizer($before_widget);
    		
    		if ( is_user_logged_in() ) :
    			do_action( 'bp_before_sidebar_me' ); ?>
    			<div id="sidebar-me">
    				<div id="bpavatar">
    					<?php bp_loggedin_user_avatar( 'type=full' ); ?>
    				</div>
    				<ul>
    					<li id="username"><a href="<?php bp_loggedin_user_link(); ?>"><span translate="no"><?php bp_loggedin_user_fullname(); ?></span></a></li>
    					<li><a href="<?php echo bp_loggedin_user_domain() . BP_XPROFILE_SLUG ?>/" title="<?php _e('View profile','vibe'); ?>"><?php _e('View profile','vibe'); ?></a></li>
    					<li id="vbplogout"><a href="<?php echo wp_logout_url( get_permalink() ); ?>" id="destroy-sessions" rel="nofollow" class="logout" title="<?php _e( 'Log Out','vibe' ); ?>"><i class="icon-close-off-2"></i> <?php _e('LOGOUT','vibe'); ?></a></li>
    					<li id="admin_panel_icon"><?php if (current_user_can("edit_posts"))
    				       echo '<a href="'.vibe_site_url() .'wp-admin/" title="'.__('Access admin panel','vibe').'"><i class="icon-settings-1"></i></a>'; ?>
    				  </li>
    				</ul>	
    				<ul>
            <?php
            $nav = '';
            if(function_exists('bp_course_get_nav_permalinks'))
              $nav = bp_course_get_nav_permalinks();
            $loggedin_menu = array(
              'courses'=>array(
                          'icon' => 'icon-book-open-1',
                          'label' => __('Courses','vibe'),
                          'link' => bp_loggedin_user_domain().BP_COURSE_SLUG
                          ),
              'stats'=>array(
                          'icon' => 'icon-analytics-chart-graph',
                          'label' => __('Stats','vibe'),
                          'link' => bp_loggedin_user_domain().BP_COURSE_SLUG.'/'. BP_COURSE_STATS_SLUG
                          )
              );
            if ( bp_is_active( 'messages' ) ){
              $loggedin_menu['messages']=array(
                          'icon' => 'icon-letter-mail-1',
                          'label' => __('Inbox','vibe').(messages_get_unread_count()?' <span>' . messages_get_unread_count() . '</span>':''),
                          'link' => bp_loggedin_user_domain().BP_MESSAGES_SLUG
                          );
              $n=bp_notifications_get_unread_notification_count( bp_loggedin_user_id() );
              $loggedin_menu['notifications']=array(
                          'icon' => 'icon-exclamation',
                          'label' => __('Notifications','vibe').(($n)?' <span>'.$n.'</span>':''),
                          'link' => bp_loggedin_user_domain().BP_NOTIFICATIONS_SLUG
                          );
            }
            if ( bp_is_active( 'groups' ) ){
              $loggedin_menu['groups']=array(
                          'icon' => 'icon-myspace-alt',
                          'label' => __('Groups','vibe'),
                          'link' => bp_loggedin_user_domain().BP_GROUPS_SLUG 
                          );
            }
            
            $loggedin_menu['settings']=array(
                          'icon' => 'icon-settings',
                          'label' => __('Settings','vibe'),
                          'link' => bp_loggedin_user_domain().BP_SETTINGS_SLUG
                          );
            $loggedin_menu = apply_filters('wplms_logged_in_top_menu',$loggedin_menu);
            foreach($loggedin_menu as $item){
              echo '<li><a href="'.$item['link'].'"><i class="'.$item['icon'].'"></i>'.$item['label'].'</a></li>';
            }
            ?>
    				</ul>
    			
    			<?php
    			do_action( 'bp_sidebar_me' ); ?>
    			</div>
    			<?php do_action( 'bp_after_sidebar_me' );
    		
    		/***** If the user is not logged in, show the log form and account creation link *****/
    		
    		else :
    			if(!isset($user_login))$user_login='';
    			do_action( 'bp_before_sidebar_login_form' ); ?>
    			
    			
    			<form name="login-form" id="vbp-login-form" class="standard-form" action="<?php echo apply_filters('wplms_login_widget_action',vibe_site_url( 'wp-login.php', 'login-post' )); ?>" method="post">
    				<label><?php _e( 'Username', 'vibe' ); ?><br />
    				<input type="text" name="log" id="side-user-login" class="input" tabindex="1" value="<?php echo esc_attr( stripslashes( $user_login ) ); ?>" /></label>
    				
    				<label><?php _e( 'Password', 'vibe' ); ?> <a href="<?php echo wp_lostpassword_url( get_permalink() ); ?>" tabindex="5" class="tip" title="<?php _e('Forgot Password','vibe'); ?>"><i class="icon-question"></i></a><br />
    				<input type="password" tabindex="2" name="pwd" id="sidebar-user-pass" class="input" value="" /></label>
    				
          <div class="checkbox small">
            <input type="checkbox" name="sidebar-rememberme" id="sidebar-rememberme" value="forever" /><label for="sidebar-rememberme"><?php _e( 'Remember Me', 'vibe' ); ?></label>
          </div>
    				
    				<?php do_action( 'bp_sidebar_login_form' ); ?>
    				<input type="submit" name="user-submit" id="sidebar-wp-submit" data-security="<?php echo wp_create_nonce('wplms_signon'); ?>" value="<?php _e( 'Log In','vibe' ); ?>" tabindex="100" />
    				<input type="hidden" name="user-cookie" value="1" />
    				<?php if ( bp_get_signup_allowed() ) :
            $registration_link = apply_filters('wplms_buddypress_registration_link',site_url( BP_REGISTER_SLUG . '/' ));
    					printf( __( '<a href="%s" class="vbpregister" title="'.__('Create an account','vibe').'" tabindex="5" >'.__( 'Sign Up','vibe' ).'</a> ', 'vibe' ), $registration_link );
    				endif; ?>
          <?php do_action( 'login_form' ); //BruteProtect FIX ?>
    			</form>
    			
    			
    			<?php do_action( 'bp_after_sidebar_login_form' );
    		endif;
    		
    		echo vibe_sanitizer($after_widget);
    	}
    	
    	/* Updates the widget */
    	
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		return $instance;
    	}
    	
    	/* Creates the widget options form */
    	
    	function form( $instance ) {
    		
    	}
    
    } 
    to change other texts you need to overwrite the header template file using child theme.
    #382378
    Physiotutors
    Participant
    This reply has been marked as private.
    #382412
    Anshuman Sahu
    Keymaster
    To change other texts you need to overwrite the header template file using child theme. You can see these tags in header.php file .you are using sleek header then please overwrite the header-sleek.php file.
    #382451
    Physiotutors
    Participant
    This reply has been marked as private.
    #382510
    Anshuman Sahu
    Keymaster
    <?php
    //Header File
    if ( ! defined( 'ABSPATH' ) ) exit;
    ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <?php
    wp_head();
    ?>
    <body <?php body_class(); ?>>
    <div id="global" class="global">
        <?php
            get_template_part('mobile','sidebar');
        ?> 
        <div class="pusher">
            <?php
                $fix=vibe_get_option('header_fix');
            ?>
            <header class="sleek <?php if(isset($fix) && $fix){echo 'fix';} ?>">
                <div class="<?php echo vibe_get_container(); ?>">
                    <div class="row">
                        <div class="col-md-9 col-sm-4 col-xs-4">
                            <?php
    
                                if(is_front_page()){
                                    echo '<h1 id="logo">';
                                }else{
                                    echo '<h2 id="logo">';
                                }
                                $url = apply_filters('wplms_logo_url',VIBE_URL.'/assets/images/logo.png','header');
                                if(!empty($url)){
                            ?>
                                <a href="https://www.physiotutors.com/"><img src="<?php  echo vibe_sanitizer($url,'url'); ?>" alt="<?php echo get_bloginfo('name'); ?>" /></a>
                            <?php
                                }
                                if(is_front_page()){
                                    echo '</h1>';
                                }else{
                                    echo '</h2>';
                                }
    
                                $args = apply_filters('wplms-main-menu',array(
                                     'theme_location'  => 'main-menu',
                                     'container'       => 'nav',
                                     'menu_class'      => 'menu',
                                     'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s<li><a id="new_searchicon"><i class="fa fa-search"></i></a></li></ul>',
                                     'walker'          => new vibe_walker,
                                     'fallback_cb'     => 'vibe_set_menu'
                                 ));
                                wp_nav_menu( $args ); 
                            ?>
                        </div>
                        <div class="col-md-3 col-sm-8 col-xs-8">
                            <ul class="topmenu">
                                <?php
                                if ( function_exists('bp_loggedin_user_link') && is_user_logged_in() ) :
                                    ?>
                                        <li><a href="<?php bp_loggedin_user_link(); ?>" class="smallimg vbplogin"><?php $n=vbp_current_user_notification_count(); echo ((isset($n) && $n)?'<em></em>':''); bp_loggedin_user_avatar( 'type=full' ); ?><span translate="no"><?php bp_loggedin_user_fullname(); ?></span></a></li>
                                <?php
                                else :
                                    ?>  
                                    <li><a href="#login" rel="nofollow" class=" vbplogin"><span><?php _e('LOGIN','vibe'); ?></span></a></li>          
                                        <?php
                                endif;        
                                
                                if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) )  || (function_exists('vibe_check_plugin_installed') && vibe_check_plugin_installed( 'woocommerce/woocommerce.php'))) { global $woocommerce;
                                        ?>
                                        <li><a class="vbpcart"><span class="fa fa-shopping-basket"><?php echo (($woocommerce->cart->cart_contents_count)?'<em>'.$woocommerce->cart->cart_contents_count.'</em>':''); ?></span></a>
                                        <div class="woocart"><div class="widget_shopping_cart_content"><?php woocommerce_mini_cart(); ?></div></div>
                                        </li>
                                <?php
                                }
                                ?>
                            </ul>
                            <?php
                                $style = vibe_get_login_style();
                                if(empty($style)){
                                    $style='default_login';
                                }
                            ?>
                            <div id="vibe_bp_login" class="<?php echo vibe_sanitizer($style,'text'); ?>">
                            <?php
                                vibe_include_template("login/$style.php");
                             ?>
                           </div>
                        </div>
                        <a id="trigger">
                            <span class="lines"></span>
                        </a>
                    </div>
                </div>
            </header>
    you can use this code :
Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Code Block changes’ is closed to new replies.