Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter y2011

    (@y2011)

    I found the answer:

    for the logo, just upload a logo image in appearance -> customize

    for the missing image, I had old posts with images inside but not “attached” the wordpress way.

    So I had to change the pluging code to support it.

    For anyone who’s interested:

    in plugins/amp/includes/class-amp-post-template.php

    
    	private function get_post_image_metadata() {
    		$post_image_meta = null;
    		$post_image_id = false;
    
    		if ( has_post_thumbnail( $this->ID ) ) {
    			$post_image_id = get_post_thumbnail_id( $this->ID );
    		} else {
    			$attached_image_ids = get_posts( array(
    				'post_parent' => $this->ID,
    				'post_type' => 'attachment',
    				'post_mime_type' => 'image',
    				'posts_per_page' => 1,
    				'orderby' => 'menu_order',
    				'order' => 'ASC',
    				'fields' => 'ids',
    				'suppress_filters' => false,
    			) );
    
    			if ( ! empty( $attached_image_ids ) ) {
    				$post_image_id = array_shift( $attached_image_ids );
    			}
    		}
    
    		if ( ! $post_image_id ) {       // get image from inside the post
                $image_url = (string) reset(simplexml_import_dom(DOMDocument::loadHTML($this->post->post_content))->xpath("//img/@src"));
                if (!empty($image_url)) {
                    list($image_width, $image_height) = getimagesize($image_url);
                    if ($image_width && $image_height) {
                        if ($image_width < 696) {       // google require minimum width of 696  https://developers.google.com/search/docs/data-types/articles
                            $image_width = 696;
                            $image_height = intval($image_height * 696 / $image_width);
                        }
                        $post_image_meta = array(
                            '@type' => 'ImageObject',
                            'url' => $image_url,
                            'width' => $image_width,
                            'height' => $image_height,
                        );
                    }
                } else {
                    $post_image_meta = array(
                        '@type' => 'ImageObject',
                        'url' => 'https://www.your domain.co.il/sample-photo.jpg',
                        'width' => 960,
                        'height' => 720,
                    );
                }
    		}
    
    		if (!$post_image_meta) {
                $post_image_src = wp_get_attachment_image_src($post_image_id, 'full');
    
                if (is_array($post_image_src)) {
                    $post_image_meta = array(
                        '@type' => 'ImageObject',
                        'url' => $post_image_src[0],
                        'width' => $post_image_src[1],
                        'height' => $post_image_src[2],
                    );
                }
            }
    
    		return $post_image_meta;
    	}
    

    Video is disabled for mobile. see index.php

    if($section_background_video != "" && $video_background_section == ($i+1) && !$detect->isMobile() && !$detect->isTablet()){
    	$video_enable = 1;
    }

    I’d like to know if there is a way around it? I noticed that the pro version of onetone has support for .mp4 videos. I ask their support if the video will work on mobiles using the pro version?

    The theme is not much use if I cannot have video on mobiles device
    https://goldenview.bg/residence/en/

    It is in line 111

    The issue is that it still does not work well on mobiles.

    I wonder if the feature on the Pro version where I can upload the video file .webm to my site and maybe it will work with mobiles.

    MageeWP, can you confirm that uploading the video and using this feature in the Pro version will work on mobiles?

    Thank you

    to enable video on mobiles:

    in \wp-content\themes\onetone\index.php

    //@@!!  if($section_background_video != "" && $video_background_section == ($i+1) && !$detect->isMobile() && !$detect->isTablet()){
      if($section_background_video != "" && $video_background_section == ($i+1)){

    I have the same issue.

    Theme looks great on pc. does not show video on mobiles (android and iOS)

    I’ve read in other post

    We have disabled video background on mobile devices because they can’t support this feature well. Sorry for the inconvenience.

    but WTF? if it can’t play video on mobile, it is half useless

    Any suggestion to solve it is welcome

Viewing 5 replies - 1 through 5 (of 5 total)