Forum Replies Created

Viewing 15 replies - 16 through 30 (of 45 total)
  • Thread Starter little_bird

    (@little_bird)

    Hi Amit

    Yes, I uploaded the SVG in Customize > Header > Logo, and it works, but that is not the problem. I just want a different SVG logo for mobiles, so when I uploaded it in Customize > Header > Mobile Menu > Logo(optional) the logo doesn’t appear, only appears the logo for the rest of devices.

    If I tried lo upload a different png logo just for mobiles, it works. So the issue is SVG logos just for mobile devices.

    Thanks for your help

    Thread Starter little_bird

    (@little_bird)

    Hi Amit
    I am developing the site at localhost, but I installed the theme in a temporary domain and I get the same behavior, the SVG logo is not shown in mobile devices. Only the png logo is shown.

    This is the temporary site: https://site8.sirius-web.net/

    Thanks

    Thread Starter little_bird

    (@little_bird)

    Hi Amit

    No, unfortunately I still have the same issue, the responsive logo field doesn’t show the SVG logo at the front end. At the customizer the SVG logo is shown but not in the mobile page.

    Thanks

    Thread Starter little_bird

    (@little_bird)

    Hi
    I installed SVG Support By Benbodhi

    Thread Starter little_bird

    (@little_bird)

    Sure, this is the site https://site8.sirius-web.net/ but you need access to the admin panel to see the error. Where can I send you the credentials?

    Thread Starter little_bird

    (@little_bird)

    Hi Alex

    This is the widget code. It’s not too long

    class Jeru_Reltrips{
    
    	protected static $_instance = null;
    
    	protected function __construct() {
    		$this->init();	
    	}
    
    	public static function laInstancia() {
            if(is_null(self::$_instance)) {
            	self::$_instance = new self();
            }
            return self::$_instance;
    	}
    
    	public static function add_the_meta_box() {
    		add_meta_box( 'jeru_selec_trips', __( 'Related Trips in Post', 'jeruthalem' ), array('Jeru_Reltrips','display_meta_post_edit'), 'post', 'normal', 'default' );
    	}
    
    	public function init() {
    		add_action('add_meta_boxes', array('Jeru_Reltrips', 'add_the_meta_box'),10,2);
    		add_action( 'save_post',  array('Jeru_Reltrips', 'save_meta_data') );
    		add_action( 'widgets_init', function(){ register_widget( 'Jeru_Reltrips_Widget' );});
    	}
    
    	public static function display_meta_post_edit() {
    		global $post;
    		$jeru_reltrips = get_post_meta($post->ID, 'jeru_reltrips');
    		//echo "<pre>".var_dump($jeru_reltrips)."</pre>";
    		self::trips_list($jeru_reltrips);
    	}
    
    	public static function save_meta_data( $post_id ) {
    		if(isset($_POST['trip_list'])){
    			$cleanData = array();
    			foreach($_POST['trip_list'] as $val){
                    $cleanData[] = filter_var( $val, FILTER_SANITIZE_NUMBER_INT );
    			}
    
    			update_post_meta( $post_id, 'jeru_reltrips', $cleanData);
    		}else
    
    		delete_post_meta( $post_id, 'jeru_reltrips' );
    	}
    
    	public static function trips_list($listRel) {
    		 global $post;
    	 	 $langua = pll_current_language('locale');
    	 	 $theTrips = !empty($listRel) ? $listRel : array(array());
    		 $args2 = array(
    		                'post_type'         => 'trip',
    		                'post_status'       => 'publish',
    		                'posts_per_page'    =>  -1,
    						'order' => 'ASC'
    		            );
    
    		  $tripQuery2 = new WP_Query( $args2 );
    		  if($tripQuery2->have_posts() ) :?>
    		     <div>Choose the related trips for this post</div><p></p>
         <?php  while ( $tripQuery2->have_posts() ) : 
    
                	$tripQuery2->the_post();?>
                       <li><input type="checkbox" name="trip_list[]" value="<?php echo $post->ID;?>" <?php if(in_array($post->ID, $theTrips[0])){ echo 'checked="checked"';} ?>> <span><?php echo the_title(); ?></span></li>
         <?php  endwhile;
                wp_reset_postdata();
    
    	     endif;
    	}
    }
    
    class Jeru_Reltrips_Widget extends WP_Widget {
    
    	function __construct() {
               parent::__construct(
    			'related_trips_widget',
    			'Related Trips Widget',
    			array( 'description' => 'Display related trips in the sidebar' )
    		);
    	}
    
    	public function widget( $args, $instance ) {
    		if(!is_single()) {
    			return;
    		}
    		global $post;
    		$jeru_reltrips = get_post_meta($post->ID, 'jeru_reltrips');
    
    		$title  = isset( $instance['title'] ) ? $instance['title'] : '';
    
    		$title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Related Trips','jeruthalem' );
    
    		$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    
    		if(!empty($jeru_reltrips)){
    			echo $args['before_widget'];
    			 if ( $title ) {
    				echo $args['before_title'] . $title . $args['after_title'];
    			}
    			echo '<div id="only_related">';
    			$this->selected_trips_post($jeru_reltrips);
    			echo '</div>';
    			echo $args['after_widget'];
    		}
    	}
    
    	public function form( $instance ) {
    		$title     = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
    		?>
    		<p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    		<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
    
    	   <?php
    	}
    
    	public function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['title'] = sanitize_text_field( $new_instance['title'] );
    		return $instance;
    	}
    
    	private function selected_trips_post($trips_ids) {
           global $post;
           $langua = pll_current_language('locale');
    	 	  $moreD = '';
    	 	  if($langua==='en_US'):
    			   $moreD = 'More details';
    		  else:
    			   $moreD = '????? ??????';
    	      endif;
    
           $the_ids = array_map('intval', $trips_ids[0]);
           $args3 = array(
    		                'post_type'         => 'trip',
    		                'post__in'          => $the_ids,
    		                'post_status'       => 'publish',
    						'order' => 'ASC'
    		            );
    
    		  $tripQuery3 = new WP_Query( $args3 );
    		  if($tripQuery3->have_posts() ) :
                while ( $tripQuery3->have_posts() ) : 
                     $tripQuery3->the_post();?>
                	<div class="tripWrap clear">
                    	<div class="tripContent">
                    		<div class="tripPic">	
                    			<?php  echo wp_get_attachment_image( get_post_meta( $post->ID, '_jerutometas_trippic_id', 1 ), 'trip-thumb' );
                    			?>
                    		</div> <!-- tripPic -->
                    		<div class="tripText">
                    			<div class="tripTitle">
                                   <a href="" data-izimodal-open="#mod-<?php echo $post->ID;?>" class="modTri" data-izimodal-group="trips"><?php echo the_title();?></a>
                    			</div>
                    			<div class="tripDetails">
                    				<a href="" data-izimodal-open="#mod-<?php echo $post->ID;?>" class="modTri" data-izimodal-group="trips"><?php echo get_post_meta($post->ID, '_jerutometas_tripexce', true);?></a>
                    				<div class="moreDetails"><a href=""><?php echo $moreD;?></a></div>
                    			</div>
                    		</div> <!-- tripText -->
                    	</div> <!-- tripContent -->
                    	<div id="mod-<?php echo $post->ID;?>" class="jerupop" data-izimodal-title="<?php echo the_title();?>">
    	                	
    	                	<div class="modCon">
    	                		<div class="tripDetails">
    	                				<?php echo get_post_meta($post->ID, '_jerutometas_tripdesc', true);?>
    	                		</div>
    	                	</div> <!-- modCon -->
    	                </div> <!-- jerupop -->
    
                    </div> <!-- tripWrap -->
          <?php    endwhile;
                wp_reset_postdata();
    
    	     endif;
    	}
    	
    
    }
    
    Jeru_Reltrips::laInstancia();
    
    • This reply was modified 6 years, 11 months ago by little_bird.
    Thread Starter little_bird

    (@little_bird)

    Hi Alex

    At the theme I created a custom post called Trips. At the regular post page of the blog, in the sidebar, there is a widget where appear the Trips related to that post (if the author chooses any). You can see an example in this post:
    https://site4.sirius-web.net/jerusalem-center-world/

    At the post editor, there is a metabox with the list of all the Trips for the author to choose if any is related to the post content.

    At the functions.php of the theme I created a class for the Related Trips and also I created the widget extending the WP_Widget class.

    Do you need more details of the code?

    Thread Starter little_bird

    (@little_bird)

    Hi Alex

    Disabling the Yoast plugin doesn’t solve the switch to text mode at the editor after updating the post.

    I made a test changing the the static function in my widget. The original code is:

    public static function trips_list($listRel) {
    		 global $post;
    	 	 $langua = pll_current_language('locale');
    	 	 $theTrips = !empty($listRel) ? $listRel : array(array());
    		 $args2 = array(
    		                'post_type'         => 'trip',
    		                'post_status'       => 'publish',
    		                'posts_per_page'    =>  -1,
    						'order' => 'ASC'
    		            );
    
    		  $tripQuery2 = new WP_Query( $args2 );
    		  if($tripQuery2->have_posts() ) :?>
    		     <div>Choose the related trips for this post</div><p></p>
         <?php  while ( $tripQuery2->have_posts() ) : 
    
                	$tripQuery2->the_post();?>
                       <li><input type="checkbox" name="trip_list[]" value="<?php echo $post->ID;?>" <?php if(in_array($post->ID, $theTrips[0])){ echo 'checked="checked"';} ?>> <span><?php echo the_title(); ?></span></li>
         <?php  endwhile;
                wp_reset_postdata();
    
    	     endif;
    	}

    I removed the loop and changed it for a simple input field

    public static function trips_list($listRel) {
    		 global $post;
    	 	 $langua = pll_current_language('locale');
    	 	 $theTrips = !empty($listRel) ? $listRel : array(array());
    		 $args2 = array(
    		                'post_type'         => 'trip',
    		                'post_status'       => 'publish',
    		                'posts_per_page'    =>  -1,
    						'order' => 'ASC'
    		            );
    
    		  $tripQuery2 = new WP_Query( $args2 );
    		 ?> 
    		     <div>Choose the related trips for this post</div><p></p>
                	
                       <li><input type="checkbox" name="trip_list[]" value="67"> <span>One single trip</span></li>
       
          <?php
            wp_reset_postdata();
    	     
    	}
    }

    Removing the loop at the widget code solved the issue of the Page builder editor!!
    I don’t understand at all why this loop is affecting the Page builder behavior.

    Do you have any idea?

    Thread Starter little_bird

    (@little_bird)

    Hi Alex

    I enabled the WP_DEBUG mode but it didn’t show any PHP error message or warning. At the console in my browser I didn’t see any error from the Page Builder plugin but I discover an error from the Yoast SEO plugin due to a conflict with the Page Builder.
    This is the error at the console:
    wp-seo-post-scraper-703.min.js?ver=7.0.3:13 Error: unable to tokenize
    at Object.end (wp-seo-post-scraper-703.min.js?ver=7.0.3:13)
    at l (wp-seo-post-scraper-703.min.js?ver=7.0.3:1)
    at g (wp-seo-post-scraper-703.min.js?ver=7.0.3:1)
    at n (wp-seo-help-center-703.min.js?ver=7.0.3:6)
    at r (wp-seo-help-center-703.min.js?ver=7.0.3:6)
    at r (wp-seo-post-scraper-703.min.js?ver=7.0.3:1)
    at r (wp-seo-post-scraper-703.min.js?ver=7.0.3:1)
    at e.exports (wp-seo-post-scraper-703.min.js?ver=7.0.3:1)
    at e.exports (wp-seo-post-scraper-703.min.js?ver=7.0.3:13)
    at Object.e.exports [as calculateFleschReading] (wp-seo-post-scraper-703.min.js?ver=7.0.3:13)

    This error appears many times when I used the Image Widget at the Page Builder. When I only use the SiteOrigen Editor widget there isn’t any error message at the console. Anyway, I still have the issue with my widget code and the Page Builder and I pretty sure is something related to the custom WP_Query after hours of debugging, but I can’t why this query is affecting the Page builder performance.

    • This reply was modified 6 years, 11 months ago by little_bird.
    Thread Starter little_bird

    (@little_bird)

    Hi Alex

    Thanks for your reply. I am very sorry I’m responding to you message until now, but somehow I didn’t receive the support replies in my email.
    Unfortunately the site is having the same switch at the editor after updating the posts.
    Regarding the site’s theme, it is a custom one I built and the issue occurs with or without the widget on the post pages.

    I forgot to mention that the custom widget I built also adds a metadata box with multiple selection (a list of custom post) at the bottom of the post editor page.

    Thanks for your help.

    • This reply was modified 6 years, 11 months ago by little_bird.
    Thread Starter little_bird

    (@little_bird)

    I already uninstalled the plugin.

    Thread Starter little_bird

    (@little_bird)

    Thanks for your help

    Thread Starter little_bird

    (@little_bird)

    Hi amboutwe

    Thanks for your answer. So, since the pages are not generated by the plugin, Can I just use the “Remove URLs” tool at the Google Search Console to not getting the 404 errors anymore?

    Thread Starter little_bird

    (@little_bird)

    Hi Uwhoosh

    My site is https://www.elrunrun.net

    Thread Starter little_bird

    (@little_bird)

    Hi Thomas

    Thanks for your answer. I know YouTube videos can be embedded just using the URL, but I just wanted to set my own CSS for the player which is possible to do with the native player, that’s why I prefer it.

    I checked the code at the browser. The problem is that some JavaScript is not calculating the correct height of the iframe when I exit full screen and I don’t know which code does it.

Viewing 15 replies - 16 through 30 (of 45 total)