Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #884122

    Valerio
    Participant

    Hi,
    I am monitoring all the source URLs giving a 404 error; in the log I find many entries like this:

    Source URL: /mywebsite/subpage1/page1/closedhand.cur
    Referrer: /mywebsite/subpage1/page1/

    This is happening to all pages that contain an image gallery, as far as I can see.
    How can I fix this?

    Many thanks.

    #884125

    Valerio
    Participant
    This reply has been marked as private.
    #884990

    Rad
    Moderator

    Hi there,

    Thanks for posting in.

    1. You have old custom code that is no more applicable for the cornerstone. It’s related to this file http://www.floridamasters.co.uk/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js which still points to X shortcode. Please remove any custom code related to lightbox from your child theme’s functions.php, but make sure to back it up.

    2. From what page you’re getting the missing cursor? Would you mind providing a screen-recording of this error. I can’t find it on my end.

    Thanks!

    #889697

    Valerio
    Participant

    Hi!

    1.
    so can I just remove the following or should I replace it with something else to achieve the same result?

    add_action('wp_footer', 'enqueue_lightbox_script');
    function enqueue_lightbox_script() {
    echo '<script type="text/javascript" src="' . home_url() . '/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js"></script> <script> jQuery(document).ready(function(){jQuery(".gallery-icon a").iLightBox({skin: "light",linkId: "gallery-image",overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: "horizontal",controls: {thumbnail: false}});}); </script>';
    }

    2.
    I can see those errors in my “redirection” plugin (404 logs), you can see that in the attachment.

    3.
    in my customizer “Edit Global Javascript” i have the following functions that are both not working anymore since last update to X:

    
    jQuery( function($) {
    
    $(document).on('click', '.x-accordion-toggle, .x-nav-tabs .x-nav-tabs-item a', function( e ){
    $('html, body').stop();
    });
    
    });
    
    jQuery( function($) { 
    
    $('.x-brand.text').each( function(){
    
    var logo_parts = $ ( this ).text().trim().split(' ');
    
    $( this ).html ( '<span class="part1">' + logo_parts[0] + '</span> <span class="part2">' + logo_parts[1] + '</span>'  );
    
    } );
    
    } );
    
    

    One is the accordion tabs (you can see it on the homepage) and the second is to have the two words Logo in 2 colors.
    Can you help me with this, please?

    #889700

    Valerio
    Participant
    This reply has been marked as private.
    #889728

    Valerio
    Participant

    Hi again,
    well, apparently my question #3 is resolved. I deleted the cache previously with no changes so I don’t know why it is now working. Anyway, just ignore #3.

    I hope you can help me with the functions.php above.
    Thanks

    #890022

    Zeshan
    Member

    Hi Valerio,

    Glad to hear #3 is resolved. 🙂

    As for the issue in functions.php file, please replace following code:

    add_action('wp_footer', 'enqueue_lightbox_script');
    function enqueue_lightbox_script() {
    echo '<script type="text/javascript" src="' . home_url() . '/wp-content/plugins/x-shortcodes/js/dist/site/vendor-ilightbox.min.js"></script> <script> jQuery(document).ready(function(){jQuery(".gallery-icon a").iLightBox({skin: "light",linkId: "gallery-image",overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: "horizontal",controls: {thumbnail: false}});}); </script>';
    }
    

    With this:

    add_action('wp_footer', 'enqueue_lightbox_script');
    function enqueue_lightbox_script() {
    echo '<script type="text/javascript" src="' . home_url() . '/wp-content/plugins/cornerstone/assets/js/dist/site/vendor-ilightbox.min.js"></script> <script> jQuery(document).ready(function(){jQuery(".gallery-icon a").iLightBox({skin: "light",linkId: "gallery-image",overlay: {opacity: 0.875,blur: true},styles: {prevScale: 0.75,prevOpacity: 0.75,nextScale: 0.75,nextOpacity: 0.75},path: "horizontal",controls: {thumbnail: false}});}); </script>';
    }
    

    Thank you!

    #890127

    Valerio
    Participant
    This reply has been marked as private.
    #890734

    Jade
    Moderator

    Hi Valerio,

    Please try this:

    function x_shortcode_recent_posts_v2code( $atts ) {
      extract( shortcode_atts( array(
        'id'          => '',
        'class'       => '',
        'style'       => '',
        'type'        => '',
        'count'       => '',
        'category'    => '',
        'offset'      => '',
        'orientation' => '',
        'no_image'    => '',
        'fade'        => ''
      ), $atts, 'recent_posts' ) );
      
      $allowed_post_types = apply_filters( 'cs_recent_posts_post_types', array( 'post' => 'post' ) );
      $type = ( isset( $allowed_post_types[$type] ) ) ? $allowed_post_types[$type] : 'post';  
    
      $id            = ( $id          != ''          ) ? 'id="' . esc_attr( $id ) . '"' : '';
      $class         = ( $class       != ''          ) ? 'x-recent-posts cf ' . esc_attr( $class ) : 'x-recent-posts cf';
      $style         = ( $style       != ''          ) ? 'style="' . $style . '"' : '';
      $type          = ( $type        == 'portfolio' ) ? 'x-portfolio' : 'post';
      $count         = ( $count       != ''          ) ? $count : 3;
      $category      = ( $category    != ''          ) ? $category : '';
      $category_type = ( $type        == 'post'      ) ? 'category_name' : 'portfolio-category';
      $offset        = ( $offset      != ''          ) ? $offset : 0;
      $orientation   = ( $orientation != ''          ) ? ' ' . $orientation : ' horizontal';
      $no_image      = ( $no_image    == 'true'      ) ? $no_image : '';
      $fade          = ( $fade        == 'true'      ) ? $fade : 'false';
    
      $js_params = array(
        'fade' => ( $fade == 'true' )
      );
      
      $data = cs_generate_data_attributes( 'recent_posts', $js_params );
    
      $output = "<div {$id} class=\"{$class}{$orientation}\" {$style} {$data} data-fade=\"{$fade}\" >";
    
        $q = new WP_Query( array(
          'orderby'          => 'date',
          'post_type'        => "{$type}",
          'posts_per_page'   => "{$count}",
          'offset'           => "{$offset}",
          "{$category_type}" => "{$category}"
        ) );
    
        if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
    
          if ( $no_image == 'true' ) {
            $image_output       = '';
            $image_output_class = 'no-image';
          } else {
            $image_output       = '<div class="x-recent-posts-img">' . get_the_post_thumbnail( get_the_ID(), 'entry-cropped', NULL ) . '</div>';
            $image_output_class = 'with-image';
          }
    
          $output .= '<a class="x-recent-post' . $count . ' ' . $image_output_class . '" href="' . get_permalink( get_the_ID() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ) . '">'
                     . '<article id="post-' . get_the_ID() . '" class="' . implode( ' ', get_post_class() ) . '">'
                       . '<div class="entry-wrap">'
                         . $image_output
                         . '<div class="x-recent-posts-content">'
                           . '<h3 class="h-recent-posts entry-title">' . get_the_title() . '</h3>'
                           . '<span class="x-recent-posts-date date updated">' . get_the_date() . '</span>'
                           . '<span class="vcard author" style="display:none;"><span class="fn">'. get_the_author().'</span></span>'
                         . '</div>'
                       . '</div>'
                     . '</article>'
                   . '</a>';
    
        endwhile; endif; wp_reset_postdata();
    
      $output .= '</div>';
    
      return $output;
    }
    
    add_action('wp_head', 'recent_posts_rebinding');
    
    function recent_posts_rebinding () {
      remove_shortcode( 'x_recent_posts' );
      add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2' );
    }
    #891619

    Valerio
    Participant

    I have applied the changes. Many thanks!

    #891668

    Valerio
    Participant
    This reply has been marked as private.
    #892431

    Jade
    Moderator

    Hi Valerio,

    Please try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

    Let us know how it goes.