Modify jQuery Sliders to Display Post Excerpt and Link to Full Blog Post

[box type=”info”]Only possible in Karma v3.0.4 and lower[/box] By default the jQuery Slider requires that you create a separate Posts Category to display specific Slides. Not Blog Posts. This is because Karma is not a Blog theme, it is a full CMS Corporate Theme meant for all sort of websites for services, companies, products, personal, etc. Thus the Slider, instead of tying in to the Blog, it is meant to showcase a Product, Service, or anything else that you wish to call quick attention to from your visitors. However you can modify the code to have the Slider display your Posts excerpt and link them to the full Posts in the Blog. For this, just follow instructions bellow carefully:

  1. Via FTP in your server access jQuery Page Template (template-homepage-jquery.php) or jQuery (2) Page Template (template-homepage-jquery.php)
  2. The Template can be found in /wp-content/themes/Karma/ directory
  3. Open the file and look for the following line of code around line 70 (jQuery Template) or line 66 (jQuery 2 Template):
  4. <?php the_content(); ?>
  5. And replace that line with the following 2 lines of code:
    <?php limit_content(60,  true, ''); ?> <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><span>Read More →</span></a>>
  6. And save the file.

60 Is the number of words the Excerpt will show before the “Read More” link. Adjust that number as needed. You may also change the Read More words with your own choice. Now, the Slider by default shows an unlimited number of Slides, this is again because it is meant to have a specific Category which allows you to control the number of Slides. With this modification you will be showing Posts from your Blog so its good to control how many Slides it will show. We recommend setting it to show about 8 or 10 Slides only. It is our experience that website visitors will not spend too much time viewing all Slides in a Slider. To set a specific number of Slides (Posts) just follow instructions bellow carefully:

  1. Via FTP in your server access jQuery Page Template (template-homepage-jquery.php) or jQuery (2) Page Template (template-homepage-jquery.php)
  2. The Template can be found in /wp-content/themes/Karma/ directory
  3. Open the file and look for the following line of code around line 33 (jQuery Template) or line 23 (jQuery 2 Template):
    $query_string ="posts_per_page=100&cat=$jcycle_category_id";
  4. And change the number 100 to a much smaller number to fit your needs. Again our recommendation would be 10
  5. And save the file.

Furthermore, if you still wish to make this customization and still have the Slider pull for a specific Category, then still set that Category in Site Options > Homepage Settings > jQuery Slider Post Category. To have it pull for any Category, then do not select a Category in this setting. (click screenshot for a full-size view)