Recent Update Crashes Website

The 5.1.5 update crashes my website. I have tried disabling other plug-ins and steps for checking conflicts. Can you please advise.

Hello Melanie,

Thanks for writing to us.

Thanks for checking the plugin conflict, It might be the issue of version compatibility, JS/CSS customization or cache issue. I would suggest you troubleshoot with a few of the common issues before we investigate your settings.

  1. Testing For Theme Related Issue
  2. Testing For Plugin Conflict
  3. Theme Update
  4. Child Theme
  5. Css/Js Customization
  6. Increasing Php Memory Limit
  7. Disabling Cache
  8. Disabling Cdn
  9. Permalinks
  10. Version Compatibility

If none of those work, It would be best if you could copying your live website to your staging area. and send your details in a secure note so that we can investigate your setting without breaking your live site. Please provide the following details

  • WordPress Login URL
  • Admin level username and password
  • FTP Details

You can find the Secure Note button at the bottom of your posts

Thanks

Added a secure note to initial post.

Hi Melanie,

Thanks for providing all your details!

First and foremost, I would to request a screenshot which part of your website crashes by the updates. Providing screenshot of before and after is a great help!

Second, I suggest that you update your cornerstone plugin to the latest version because currently you have an old cornerstone plugin version 5.1.2 and you have the latest version of X theme 8.1.5 then they are not compatible with each other.

Hope that helps.

Thank you.

I can’t update the plug because it crashes my site.

The Cornerstone update causes the home page of my website to look like this. I have already tried disabling other plugins. I am rolling back the update to the plugin I just did to take this picture as I need my site active today. Thanks!

Hi Melanie,

The given credentials is not working. I suggest that you uninstall/delete your latest version of cornerstone plugin to avoid any conflict when updating your X theme. After, deleting the cornerstone, please update your X theme to the latest version and then install again the cornerstone plugin.

On the other hand, If you can’t access your admin dashboard, I suggest that you use FTP and locate this path wp-content/ plugins and rename the cornerstone plugin to deactivate it.

Hope that helps.

Thank you.

I just copied and pasted the credentials and they worked fine. Can you try logging in again?

Hi Melanie,

It seems that the X (version 8.1.5) theme has been updated to the latest version but the Cornerstone (version 5.1.2) has not been updated to the latest version. The issue you are having might be due to the incompatibility between X and Cornerstone. I would also suggest you follow the below steps while updating the Cornerstone, by following the below steps.

  1. Delete the existing Cornerstone plugin from Appearance > Plugin first.
  2. After deletion of the Cornerstone, please use the link in the dashboard to automatically install the Cornerstone.

Hope it helps.
Thanks

This did not work. I uninstalled and reinstalled cornerstone and the current update still crashes. I am very punctual about updating about updating my plugins and something with 5.1.5 cornerstone update crashes my site every time. If I roll back to 5.1.2, the website works fine so it is not the incompatibility between Theme X and the outdated cornerstone plugin that is crashing the site. Please advise, if I can’t get this resolved I will have to move on from the plugin.

Hi Melanie,

We’re sorry for the inconvenience but we need to confirm the issue by checking your WordPress dashboard. Please update your credentials because it is not working, check the secure note confirming that the credentials is not working on our end.

Hope that helps.

Thank you.

See private note.

Hello Melanie,

The issue is caused by a custom PHP code in your child theme’s functions.php file. You have added this:

function x_shortcode_recent_posts_v2code( $atts ) {
  extract( shortcode_atts( array(
    'id'           => '',
    'class'        => '',
    'style'        => '',
    'type'         => 'post',
    'count'        => '',
    'category'     => '',
    'offset'       => '',
    'orientation'  => '',
    'show_excerpt' => 'false',
    'no_sticky'    => '',
    'no_image'     => '',
    'fade'         => ''
  ), $atts, 'x_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 . '"' : '';
  $count         = ( $count        != ''     ) ? $count : 3;
  $category      = ( $category     != ''     ) ? $category : '';
  $category_type = ( $type         == 'post' ) ? 'category_name' : 'portfolio-category';
  $offset        = ( $offset       != ''     ) ? $offset : 0;
  $orientation   = ( $orientation  != ''     ) ? ' ' . $orientation : ' vertical';
  $show_excerpt  = ( $show_excerpt == 'true' );
  $no_sticky     = ( $no_sticky    == 'true' );
 /* $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}",
      'ignore_sticky_posts' => $no_sticky
    ) );

    if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
/*
      if ( $no_image == 'true' ) {
        $image_output       = '';
        $image_output_class = 'no-image';
      } else {
        $image              = wp_get_attachment_image_src( get_post_thumbnail_id(), 'entry-cropped' );
        $bg_image           = ( $image[0] != '' ) ? ' style="background-image: url(' . $image[0] . ');"' : '';
        $image_output       = '<div class="x-recent-posts-img"' . $bg_image . '></div>';
        $image_output_class = 'with-image';
      }
*/
       $excerpt = ( $show_excerpt ) ? '<div class="x-recent-posts-excerpt"><p style="color:initial;">' . preg_replace('/<a.*?more-link.*?<\/a>/', '', cs_get_raw_excerpt() ) . '</p></div>' : '';

      $output .= '<a class="x-recent-post' . $count . ' ' . $image_output_class . '" href="' . get_permalink( get_the_ID() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to: "%s"', 'cornerstone' ), 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">' . get_the_title() . '</h3>'
                       . '<span class="x-recent-posts-date">' . get_the_date() . '</span>'
                        . $excerpt
                     . '</div>'
                   . '</div>'
                 . '</article>'
               . '</a>';

    endwhile; endif; wp_reset_postdata();

  $output .= '</div>';

  return $output;
}
// =============================================================================

add_action('wp_head', 'change_recent_posts_to_v2');
function change_recent_posts_to_v2() {
  remove_shortcode( 'x_recent_posts' );
  add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2code' );
}
// =============================================================================

These line codes are outdated and need to be removed. Please remove it first and then update your theme. We highly recommend that you use the latest Post element in displaying the recent posts replacing your recent post [recent_post ...] shortcode. Kindly check out this documentation to learn this new Post element:

Kindly let us know how it goe.

Hi Melanie,

Please let us know if the issue in your website was already solved by my colleague Ruenel.

Thank you.

Hi Melanie,

I also wanted to chime in and advise that the code could also be fixed by replacing cs_get_raw_excerpt with cs_get_excerpt_for_social.

Muted, /**/, the shortcode in functions.php. Replacement code didn’t work.

Deactivated Childe Theme Configurator plugin.

Updated Cornerstone to latest version and it was a success!

Since the shortcode function is gone now. How do I include excerpts to Recent Posts using classic element?

Hello Melanie,

As per @Alexander’s advice, I went ahead and replaced the cs_get_raw_excerpt function with cs_get_excerpt_for_social in your child theme’s functions.php file. The classic recent posts element is now displaying the excerpts. If ever you want to have a modern look of the recent post items display, please consider checking the Post element. With this new Post element, you’ll have more options and have full control over what information you want to display and how it would look like.

Best Regards.

1 Like

I actually tried using the Looper module and it didn’t work for me stylistically.
I’ll have to update the whole design layout of the homepage if I apply the latest Cornerstone Post Element.
Will consider during 2nd quarter updates.

Thank you all for your help and assistance. I learned a lot.

You are most welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.