Not showing the category page

I can not see the pages with the categories: http://www.labottegalab.com/

I display this page (screenshot)…
Exemple:
http://www.labottegalab.com/category/art-2/
http://www.labottegalab.com/category/news/

Help me please

Thanks
Best regards

Hi There,

Thanks for writing in! Could you please try re-generating your permalink settings by head over to Settings -> Permalinks section and then select the option ‘Postname’ and save the changes. Then try testing your Category pages again.

If that doesn’t help, try disabling your 3rd party plugins to see if there’s any plugin conflict. Then you can activate your plugins one by one to see which plugin cause this issue.

Let us know how it goes.
Thanks!

Hi!

Thanks for your support…
I tried without getting results :singhiozzare:

other solutions?

I have disabled all the plugins but without result…
I’m waiting for help… :slight_smile:

Hi There,

Can you also try switching to your parent theme and see if this issue is related to your child theme. Also you can try Resetting your .htaccess file by connecting to your FTP account and renaming it to .htaccess-bak. Then in WordPress Admin Menu, go to Settings > Permalinks, select the Postname option and Save Changes.

Also check your PHP version running on your server and make sure that you’re running at least PHP v5.6.x or later to avoid incompatibility issues.

If that doesn’t help, send your login credentials in a secure note to check your issue further.

Thanks!

Unfortunately I can not access FTP…
Here are my login credentials.

I’m waiting your precious help…

Hi there,

I checked your website and added a Test Post and a Test Category and the same problem happened.
I checked the same case on my installation and it is working ok.

Then I investigated more and changed the theme to the default 2015 template and it worked.

So it seems that your version of the theme is corrupt. Please reinstall the theme manually:

And then go to X > Settings and click on Clear Style Cache button.

Thank you.

Hi!
thank you so much…
I installed manually the X theme and the child theme…the second time, I renamed the file zip. but all looks the same. :sob:

I’m desperate.

Hey There,

I have investigated the issue and it turns out that it is because of your settings in the Theme Options, X > Theme Options > Ethos > Post Slider for Archive. You have enabled it and set to display Featured yet there aren’t any feature post for your slider. I have disabled this option and now the post items is showing in the category pages.

Please check your site now.

Thank you RueNel! Now this problem is solved finally! :smiley:

But I would also like to see the image,
I do not see why I disabled in the post, with the custom CSS…

.category-in-vendita .entry-featured { display: none; }

Because in some categories I have already inserted the image or custom slides (screenshot) and I do not want to see the default image…

is there a way to disable only the inside of the article in specific category?

Thank you so much for the support!

Hi There,

Please add the following code under functions.php file locates in your child theme:

add_filter('body_class','add_category_to_single');
function add_category_to_single($classes) {
    if (is_single() ) {
      global $post;
      foreach((get_the_category($post->ID)) as $category) {
        // add category slug to the $classes array
        $classes[] = $category->category_nicename;
      }
    }
    // return the $classes array
    return $classes;
}

After that update your custom CSS to this:

.single.in-vendita .entry-featured { display: none; }

Hope it helps :slight_smile:

Thanks!! :smiley:

Finally this works …but now, I don’t have the excerpt summary in the recent post, under the title…
I think it’s stopped working…
How can I solve?
I’d like to show like this example: category / Title / excerpt…that would be great!

We couldn’t be doing this without you! :relaxed:

Hi again,

I added the following code in your Child Theme’s functions.php file:

// Displaying Excerpt in Recent Posts
// =============================================================================

function x_shortcode_recent_posts_v2( $atts ) {
  extract( shortcode_atts( array(
    'id'           => '',
    'class'        => '',
    'style'        => '',
    'type'         => 'post',
    'count'        => '',
    'category'     => '',
    'offset'       => '',
    'orientation'  => '',
    'show_excerpt' => 'true',
    '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 : ' horizontal';
  $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>' . 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( csi18n('shortcodes.recent-posts-permalink'), 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_filter('wp_head', 'custom_recent_posts');

function custom_recent_posts() {
  remove_shortcode( 'x_recent_posts' );
  remove_shortcode( 'recent_posts' );
  add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2' );
  add_shortcode( 'recent_posts', 'x_shortcode_recent_posts_v2' );
}

This seems to have fixed the issue, If you need to adjust the excerpt length you can refer to the following thread also https://theme.co/apex/forum/t/recent-post-excerpt-size/27621/2

Please check your site now.

Thanks!

Thanks @Nabeel… :arrossire:

What can I add to show categories and date above the title?

Hi again,

To display meta data above the title, try replacing the previous code with the following code:

// Displaying Excerpt in Recent Posts
// =============================================================================

function x_shortcode_recent_posts_v2( $atts ) {
  extract( shortcode_atts( array(
    'id'           => '',
    'class'        => '',
    'style'        => '',
    'type'         => 'post',
    'count'        => '',
    'category'     => '',
    'offset'       => '',
    'orientation'  => '',
    'show_excerpt' => 'true',
    '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 : ' horizontal';
  $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';
      }
	  
	  $cat = get_the_category();
	  $category = $cat[0]->name;

      $excerpt = ( $show_excerpt ) ? '<div class="x-recent-posts-excerpt"><p>' . 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( csi18n('shortcodes.recent-posts-permalink'), 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">'
                       . '<span style="margin-bottom: 10px;" class="x-recent-posts-date">' . get_the_date() . ' ' . $category . ' </span>'
                       . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>'
                        . $excerpt
                     . '</div>'
                   . '</div>'
                 . '</article>'
               . '</a>';

    endwhile; endif; wp_reset_postdata();

  $output .= '</div>';

  return $output;

}

add_filter('wp_head', 'custom_recent_posts');

function custom_recent_posts() {
  remove_shortcode( 'x_recent_posts' );
  remove_shortcode( 'recent_posts' );
  add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2' );
  add_shortcode( 'recent_posts', 'x_shortcode_recent_posts_v2' );
}

Then find and remove the following CSS code:

.x-recent-posts .x-recent-posts-date {
    display: none;
}

Let us know how this goes!

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