Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter codingninja

    (@codingninja)

    Hi Kelly,

    Is there a way to direct message or email you for this?

    Thanks!

    Thread Starter codingninja

    (@codingninja)

    Oh it looks like multiple people have had this issue already. Sorry for re-posting. If this is a thing that only happens for certain websites and not others, perhaps it would be good to know what solution works for this case. I wasn’t able to find the answer in the other discussions.

    rattler98, you may add it in any javascript file that is after your jQuery library. You would also want it to be after the jQuery plugin for metaslider.

    For example, in this case, it’s in script.js in the theme directory. Generally you want this to be the last Javascript file loaded if you want to use it to control various plugins. Depending on how your site is set up, your scripts may be in the <head> rather than the bottom of the <body>. In this example, however, the scripts are at the bottom of the <body>.

    <!-- head stuff here -->
    <body>
    <!-- page content -->
    
    <script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.11.3'></script>
    <script type='text/javascript' src='/wp-content/plugins/ml-slider/assets/sliders/flexslider/jquery.flexslider-min.js?ver=3.3.5'></script>
    <-- other scripts -->
    <script type='text/javascript' src='/wp-content/themes/your-theme/js/script.js?ver=4.3.1'></script>
    </body>
    </html>

    I think the image itself is blurry. WP Nivo Slider may resize images to the dimensions you set, so all the slides are the same size. In this case, it could be that the original image was smaller than the resized dimensions.

    See the image here:
    https://lynsmith.org/wp-content/uploads/nivoslider4wp_files/32_s.jpeg

    Did you make sure the files themselves are also UTF-8 encoding from your text editor? Also are they foreign characters that have the ? or are they all English.

    Did you want the font-size to be 100px? Also what did you want as the font-weight? The font-weight availability also depends on what font you are using.

    Examples:
    font-size: 100px;
    font-weight: 400;

    400 is normal, 300 is light, 600 or 700 are bold. Or you may use values such as “normal” or “bold” for font-weight as well.

    This is a character encoding issue. Is your site template set to UTF-8? Like does it have a line that says this or something similar?
    <meta charset="utf-8">

    Also are the actual template pages using UTF-8 encoding?

    This may help:

    https://trendlife.dk/wp-content/themes/canvas/css/layout.css?ver=4.1
    Inside this:
    ul.nav {
    }

    Change width: auto; to width: 100%;

    I posted this on a different forum, but I’ll post it here as well, as it may be helpful if you’re still looking for an expire slides functionality:

    jQuery bit:

    $('.slides li').each(function(){
            if($(this).find('.expire').length) {
                var expireDate = new Date($(this).find('.expire').text()).getTime();
                var currentDate = new Date().getTime();
                if(expireDate < currentDate) {
                    $(this).remove();
                }
            }
        });

    You’ll want to put it inside of the jQuery(document).ready(function($){}); So if you have other scripts in there, you can add it to there.

    Put this into the Meta Slider “General” field on a slide by slide basis:
    <span class="expire">2015/1/20</span>

    And for the CSS

    .expire {
        display: none;
    }

    Note: The user will still have to delete the slide, but at least the slide disappears when expired.

    I posted this on a different forum, but I’ll post it here as well, as it may be helpful if you’re still looking for an expire slides functionality:

    jQuery bit:

    $('.slides li').each(function(){
            if($(this).find('.expire').length) {
                var expireDate = new Date($(this).find('.expire').text()).getTime();
                var currentDate = new Date().getTime();
                if(expireDate < currentDate) {
                    $(this).remove();
                }
            }
        });

    You’ll want to put it inside of the jQuery(document).ready(function($){}); So if you have other scripts in there, you can add it to there.

    Put this into the Meta Slider “General” field on a slide by slide basis:
    <span class="expire">2015/1/20</span>

    And for the CSS

    .expire {
        display: none;
    }

    Note: The user will still have to delete the slide, but at least the slide disappears when expired.

    Sorry I gave the wrong information for the jQuery bit. Please use this instead:

    $('.slides li').each(function(){
            if($(this).find('.expire').length) {
                var expireDate = new Date($(this).find('.expire').text()).getTime();
                var currentDate = new Date().getTime();
                if(expireDate < currentDate) {
                    $(this).remove();
                }
            }
        });

    You’ll want to put it inside of the jQuery(document).ready(function($){}); So if you have other scripts in there, you can add it to there. In case people miss this, here’s a repeat of the other information:

    Put this into the Meta Slider “General” field on a slide by slide basis:
    <span class="expire">2015/1/20</span>

    And for the CSS

    .expire {
        display: none;
    }

    The user will still have to delete the slide, but at least the slide disappears when expired.

    This is itissue under a different username. I have found a simple solution for expiring slides.

    This little bit of code does the trick:

    $('.slides li').each(function(){
            if($(this).find('.expire').length) {
                var expireDate = new Date($(this).find('.expire').text()).getTime();
                var currentDate = new Date().getTime();
                if(expireDate < currentDate) {
                    $(this).remove();
                }
            }
        });

    And put this into the Meta Slider “General” field on a slide by slide basis:
    <span class="expire">2015/1/20</span>

    And for the CSS

    .expire {
        display: none;
    }

    The user will still have to delete the slide, but at least the slide disappears when expired.

    Thread Starter codingninja

    (@codingninja)

    Wonderful. Thanks! I have updated it and it works ??

    Thread Starter codingninja

    (@codingninja)

    I found the solution. I just added this line of code in my CSS file and it worked:

    .flexslider {
        touch-action: pan-y !important;
    }

    In case you’re interested here’s the working code for server side caching. You may change the cache_file path. Also, you will need to comment out the die() in a few places inside the plugin file pwebonedrive.php

    Create an ajax.php file with this code in it. You will need to change pwebonedrive.php to point here instead of the admin-ajax.php file.

    <?php
    $imageID = $_REQUEST['code'];
    $cache_file = $_SERVER['DOCUMENT_ROOT']."/images/portfolio-cache/$imageID.jpg";
    $contents = "";
    if (file_exists($cache_file)) {
    	header('Content-Type: image/jpeg');
    	echo file_get_contents($cache_file);
    }
    else {
     	// Cache does not exist or force a cache
    	// Dynamically load the data and display it
    		//mimic the actual admin-ajax
    	define('DOING_AJAX', true);
    
    	if (!isset( $_REQUEST['action']))
    		die('not working');
    
    	//make sure you update this line
    	//to the relative location of the wp-load.php
    	require_once( dirname( __FILE__ ) . '/wp-load.php' );
    
    	//Typical headers
    	$action = esc_attr(trim($_REQUEST['action']));
    
    	//A bit of security
    	$allowed_actions = array(
    		'pweb_onedrive_download_file',
    		'pweb_onedrive_display_photo'
    	);
    	if(in_array($action, $allowed_actions)){
    		if(is_user_logged_in()) {
    			ob_start();
    			do_action( 'wp_ajax_'.$action );
                $contents = ob_get_contents();
               	ob_clean();
    		}
    		else {
    			ob_start();
    			do_action( 'wp_ajax_nopriv_'.$action );
                $contents = ob_get_contents();
                ob_clean();
    		}
    	}
    	else {
    		die('not working again');
    	}
    	// Save session data
    	$session_data = $contents; // Get the session data
    	$filehandle = fopen($cache_file, 'w+') or die("can't open file"); 
    
    	// open a file write session data
    	fwrite ($filehandle, $session_data);
    	// write the session data to file
    	fclose ($filehandle);
    }

Viewing 15 replies - 1 through 15 (of 22 total)