Viewing 30 posts - 1 through 30 (of 31 total)
  • Author
    Posts
  • #1288323

    Hello,
    I’m a long time Enfold user and the site I am updating has been an Enfold site for six years. I tried updating it on Thursday and using the navigation to visit any other page results in a critical error. Fortunately I used a backup plugin and restored the site back to the pre-update version.

    I’ve read a few threads in the forums, following the instructions found in one, I’ve installed a new version of the theme via ftp. This still gives me the same results. As this is a live website, I really can’t leave it like this, so I’ve restored it again.

    Is this a known issue, and should I just wait for V4.8.2?

    EDIT:
    I should also add that Critical Error page I mention is not central in the browser window, it looks like it’s shifted approximately 500px to the right.

    • This topic was modified 3 years, 9 months ago by jonrouse. Reason: Extra details
    #1288510

    Hello,
    I set up a staging site and finally got the issue down to some PHP, which was given to me by Yigit in this thread.

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
    {
    	$template_url = get_stylesheet_directory();
        	array_unshift($paths, $template_url.'/shortcodes/');
    
    	return $paths;
    }

    Going even further back Josue helped me here, and the fix Yigit gave me basically allowed me to copy shortcodes/av-helper-slideshow.php and have my custom version living in the child theme. Has the name or location of av-helper-slideshow.php in the main theme changed?

    This is a long story, but the client didn’t want the slider to be too big on a wide page, so Josue gave me code to switch out to a widescreen version at a certain pixel width.

    Just wondering if there’s a simple fix,

    Cheers
    J

    #1288518

    Hey J,

    Thanks for contacting us!

    No, the code actually has not changed. I wanted to check your page on staging site however it seems like we need logins. Could you please temporary admin logins to your staging site so we can look into it? If possible, please post FTP logins as well :)

    Regards,
    Yigit

    #1288525

    Hi Yigit,
    I don’t have FTP any more, but I’ve created a login below which I hope helps.
    The php on staging current has a /* */ wrapped around it
    Thank you!

    #1288879

    Hi jonrouse,

    I believe your issue is similar to https://kriesi.at/support/topic/homepages-wont-load-after-upgrading-to-both-4-8-and-4-81/#post-1288743
    Your av-helper-slideshow.php in the child theme might be missing this static function: default_args

    Best regards,
    Nikko

    • This reply was modified 3 years, 9 months ago by Nikko. Reason: fix grammer
    #1288925

    Hi Nikko,

    Thanks for getting back to me. I have no clue when it comes to PHP and just followed Yigit and Josue’s instructions.
    Have you amended the file using the admin access? If not, could you tell me where to add please?

    Thanks

    #1288941

    I’ve tried my hardest to get this to work by adding in default_args and get nothing but errors

    					static public function default_args( array $sc_defaults = array() )
    		{
    			$default = array(
    						'size'				=> 'featured',
    						'lightbox_size'		=> 'large',
    						'animation'			=> 'slide',
    						'transition_speed'	=> '',				//	in ms - empty for default
    						'conditional_play'	=> '',
    						'ids'				=> '',
    						'video_counter'		=> 0,
    						'autoplay'			=> 'false',
    						'bg_slider'			=> 'false',
    						'slide_height'		=> '',
    						'handle'			=> '',
    						'interval'			=> 5,
    						'class'				=> '',
    						'el_id'				=> '',
    						'css_id'			=> '',
    						'scroll_down'		=> '',
    						'control_layout'	=> '',
    						'content'			=> array(),
    						'custom_markup'		=> '',
    						'perma_caption'		=> '',
    						'autoplay_stopper'	=> '',
    						'image_attachment'	=> '',
    						'min_height'		=> '0px',
    						'lazy_loading'		=> 'disabled'
    				);
    			
    			if( empty( $sc_defaults ) )
    			{
    				return $default;
    			}
    			
    			/**
    			 * Override the defaults from shortcode options for backwards comp.
    			 */
    			return array_merge( $sc_defaults, $default );
    		}
    
    #1288943

    It seems the lines of code Josue gave me here don’t have the same attributes so I can’t apply the modifications he gave me to the latest version of av-helper-slideshow.php

    #1288976

    Hi jonrouse,

    Inside av-helper-slideshow.php, find this class: avia_slideshow, inside that class find this code/function:

    public function __destruct() 
    {
        unset( $this->config );
        unset( $this->slides );
        unset( $this->id_array );
    }

    Then add the default_args function below it.

    Best regards,
    Nikko

    #1288989

    Hi Nikko,

    My av-helper-slideshow.php doesn’t have those functions in it, it begins:

    class avia_slideshow
    	{
    		static  $slider = 0; 				//slider count for the current page
    		protected $config;	 				//base config set on initialization
    		protected $slides;	 				//attachment posts for the current slider
    		protected $slide_count = 0;			//number of slides
    		protected $id_array = array();
    		function __construct($config)

    It’s the same code Yigit helped me placing into the child theme with five years ago. The code in the latest version of the theme doesn’t match up with what Josue gave me initially, which is what I’ve been using ever since (part of it looks like this):

    $html .= "<img class='img_default' src='".$img[0]."' width='".$img[1]."' height='".$img[2]."' title='".$linktitle."' alt='".$linkalt."' $markup_url />";
    

    The closest thing I can find in the new theme version is

    $img_tag = "<img src='{$img[0]}' width='{$img[1]}' height='{$img[2]}' title='{$linktitle}' alt='{$linkalt}' {$markup_url} {$img_style} />";
    

    I’ve tried to amend the new theme using the original instructions here and it broke the slider!

    Really not sure what to do now. Originally the client was unhappy that on large screens the slider was virtually 100% vh. Essentially, the purpose was to change the slider height when viewing the site on larger screens. Josue helped me so that when the screen went over 1500px wide, the height of the slider changes to a scaled version of the original image, which are 3264 x 765 px. It’s been working fine for five years. You can see it working on the live site – linked below.

    #1289021

    Hi jonrouse,

    Can you send to us your av-helper-slideshow.php?
    You can post it in https://ufile.io/ or dropbox, then post the link in private content, so we can review the file.

    Best regards,
    Nikko

    #1289024

    Hi Nikko,
    That’s a great service, I’ve just done that – link in private content. Thanks for all your help with this.

    #1289093

    Hi jonrouse,

    Thanks, try using this file.
    I have updated it based on Enfold 4.8.1

    Best regards,
    Nikko

    #1289134

    Hi Nikko,

    Thanks so much for this. I added it to the child theme within the staging environment. Sadly, it is not quite working. If you check the link in the private area, it does not resize when reducing down to 1500px or less. It just uses the wide image and scales it down. This is the CSS I was provided with, do you see anything in this which needs to change?

    
    img.img_full{
        display: none !important;
    }
    @media only screen and (min-width: 1500px) {
        img.img_full {
            display: block !important;
        }
        img.img_default{
            display: none !important;
        }
    }
    

    Thanks again for you patience and perseverance!

    • This reply was modified 3 years, 9 months ago by jonrouse. Reason: Enfold versions in private
    #1289166

    Hi jonrouse,

    I see, can you try this file instead (link in private content) :)

    Best regards,
    Nikko

    #1289199

    Thank you Nikko.
    I’ve just replaced that in the staging child theme (and emptied cache) and it’s the same I’m afraid. Sorry!

    For some reason some of the links on the staged version are linking to the live site, easier for me to see as the WP tool bar changes from orange to black.
    The staging pages seem to be those with plain permalinks, not sure if that’s any help, but I thought it was worth mentioning.

    Thanks again.

    #1289214

    Hi jonrouse,

    I see, can you give temporary admin access to the staging site?
    Just post the credentials in private content.

    Best regards,
    Nikko

    #1289220

    Hi Nikko,
    Sure, I did set this up a few days ago

    #1289355

    Hi jonrouse,

    Thanks, can you give us steps on how we can change our IP address? since I don’t know how to do it.

    Best regards,
    Nikko

    #1289592

    Hi Nikko,

    Reply below

    #1289866

    Hi jonrouse,

    Please check in private content.

    Best regards,
    Nikko

    #1289878

    Thanks Nikko, give it a try. Fingers crossed!

    #1290045

    Hi jonrouse,

    I tried to access but I’m getting this: (my IP is still the same)

    Forbidden
    You don't have permission to access this resource.

    Best regards,
    Nikko

    #1290078

    Hi Nikko,
    Maybe I need to grant access to the main site and you can access staging through there.
    Please check private content.
    Thanks

    #1290117

    Hi jonrouse,

    Thanks, I have modified the code and I forgot the dot, here’s the lines/codes I have changed:

    line 381, from:

    $img_tag = "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$imgalt}' />";

    to:

    $img_tag .= "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$imgalt}' />";

    line 751, from:

    $img_tag = "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$linkalt}' />";

    to:

    $img_tag .= "<img src='{$img_full[0]}' width='{$img_full[1]}' height='{$img_full[2]}' alt='{$linkalt}' />";

    Best regards,
    Nikko

    • This reply was modified 3 years, 9 months ago by Nikko.
    #1290129

    Thanks Nikko,
    I can see that something has definitely changed, so thank you. However, when I visit the pages on staging I am seeing both versions of the image stacked on top of one another. I’m guessing you’re not seeing this? Link below for reference.

    Sorry this has turned into such a pain of a job!

    #1290142

    Hi jonrouse,

    No worries and thanks for your patience :)
    It seems the CSS code for it did not work since the image does not have img_full class.
    I have replaced it with this CSS code instead:

    .avia-slide-wrap > img:nth-child(2) {
        display: none;
    }
    
    @media only screen and (min-width: 1500px) {
        .avia-slide-wrap > img:nth-child(2) {
            display: block;
        }
    
        .avia-slide-wrap > img:nth-child(3){
            display: none;
        }
    }

    Best regards,
    Nikko

    #1290168

    That’s nearly there! It should be the other way around; so the taller image is displayed on sizes below 1500px, the wider image on sizes above 1500px. Hope this makes sense!

    #1290175

    Hi jonrouse,

    I see, please replace it with this code (basically 2 and 3 in nth-child is swapped):

    .avia-slide-wrap > img:nth-child(3) {
        display: none;
    }
    
    @media only screen and (min-width: 1500px) {
        .avia-slide-wrap > img:nth-child(3) {
            display: block;
        }
    
        .avia-slide-wrap > img:nth-child(2){
            display: none;
        }
    }

    Best regards,
    Nikko

    #1290185

    Perfect, that’s working great on the staging site!

    Just to check, essentially, all I need to do now is
    • update Enfold on the live site
    • replace the av-helper-slideshow.php in the child theme
    • replace those few lines of css with what you added above?

    Thank you, I owe you a beer or a cake or something!

Viewing 30 posts - 1 through 30 (of 31 total)
  • You must be logged in to reply to this topic.