Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

Blog pagination issue

full blog; pagination
    • 7 years, 1 month ago digitalstyle
      Participant

      Expired

      digital-style
      digital-style PURCHASED

      14 days ago Flag
      Hello,

      We have ran into blog pagination issue, when I click page 2 or 3, we get the same contents/posts as the first blog page. If you could take a look at this page https://www.smartdrive.net/blog/

      And scroll down and click page 2, you will get the same contents but URL changes normally. Is there a way to fix this? Let me know. Thanks in advance.

      Mirela2910
      Mirela2910 AUTHOR TEAM

      14 days ago Flag
      Hello,

      Is this page set up as blog page in General Options > Select special Pages > Post’s page?

      Please contact our support so we can guide you with more details.

      Best regards!

      digital-style
      digital-style PURCHASED

      14 days ago Flag
      Hello,

      No, it was setup with Full Blog element.

      Anyway, if I use General Options > Select special Pages > Post’s page setup instead. Is there a way to show only a specific category? Any quick snippet code for this? Thanks a lot!

      Mirela2910
      Mirela2910 AUTHOR TEAM

      13 days ago Flag
      Hello,

      I see. Sorry but you can not chose which category to display in post’s page. This can be done only using Visual Composer blog elements.

      Please open a ticket in our support forum, so we can give it a closer look and guide you.

      Best regards!

      The bold texts are for your reference. Please take a look, I will send you a WP login and SFTP info in a separate reply. Thanks a lot.

    • 7 years, 1 month ago digitalstyle
      Participant

      Expired

      This reply has been marked as private.
    • 7 years, 1 month ago Mirela
      Participant

      Hello,

      Please replace the current content of file vc_templates/home_blog.php with this:

      <?php
      /**
       * Shortcode attributes
       * @var $atts
       * @var $style
       * @var $posts_per_page
       * @var $dynamic_from_where
       * @var $dynamic_cat
       * Shortcode class
       * @var  WPBakeryShortCode_Home_Blog
       */
      $output = '';
      $atts = vc_map_get_attributes( $this->getShortcode(), $atts );
      extract( $atts );
              ob_start();
      
              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      
              if($dynamic_from_where == 'all_cat')
                query_posts('posts_per_page='.(int)$posts_per_page.'&paged='.$paged); 
              else
                query_posts('posts_per_page='.(int)$posts_per_page.'&cat='.$dynamic_cat.'&paged='.$paged );
              
              
      
              global $for_element;
              $for_element = true;
              $GLOBALS['paged'] = $paged;
              get_template_part( 'includes/view/blog/loop', $style);
      
              wp_reset_query();
              $output .= ob_get_clean();
              echo  $output;
      ?>

      I can’t do it for because the ftp does not allow importing changes files. Also you have an old version of WordPress and so, i can’t access this file from the Appearance > Editor either.
      Then check your page, the pagination should be ok.
      Let us know.

      Best regards!

    • 7 years, 1 month ago digitalstyle
      Participant

      Expired

      Hello,

      The code works just fine. Thank you so much for helping on this. Really appreciate it!

      Thanks!

Viewing 3 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password