Blog Excerpt Options

By default Karma’s Main Blog Page displays 80 words of the Post’s content in the excerpt before the “Continue Reading” button. Bellow are some other options. The file to modify is:

Karma 4.0 or higher: index.php found in /wp-content/themes/karma/ or via the Dashboard in Appearance > Editor. Karma 2.6.4 or higher: theme-template-part-content-blog.php found in /wp-content/themes/karma/ or via the Dashboard in Appearance > Editor.

Karma 2.6 or higher: content-blog.php found in /wp-content/themes/karma/ or via the Dashboard in Appearance > Editor. In Karma 4.0, the code is found at line 147. In older versions, the code is found at line 80.

If there are elements in the Post content conflicting with the excerpt.

Option #1:

Find the code:

<?php limit_content(80,  true, '');

and simply insert those elements such as video, images, etc. 80 words into the post. Since the post gets cut off at 80 words before linking to single page, those elements will only show on the single blog page.

Option #2:

Adjust the code

<?php limit_content(80,  true, '');

to a smaller number, such as 40. Then simply do the same as above but display the video at least 40 words deep into the post and the video will only show on the single blog page.

<?php limit_content(40,  true, '');

In Karma 4.0, the code is as follows:

limit_content(80,  true, '');

So you would change it as follows:

limit_content(40,  true, '');

(Make sure to disable the Post Content setting in Site Options > Blog and Posts > Posts Settings)


Remove the default Excerpt functionality and use WordPress “Read More” tag. Or display the entire Post on main Blog page without linking to Single Post.

Option #3:

Completely remove and replace:

<?php limit_content(80,  true, '');

with this:

<?php the_content();

Then manually insert a “more tag” for each blog post wherever you would like the post to get cut off and lead to single blog page. (screenshot attached for “more tag”). This up side is that it will give you full control about where each post gets trimmed off. The downside is that you would need to manually add the ‘more tag’ for each post. The same goes if you want to display the entire Post.
In Karma 4.0, there is already a setting for this. Simply look in Appearance > Site Options > Blog and Posts > Post Content To remove the “Continue Reading” button, simply remove or comment out the following in line 81:

&amp;lt;a class=&amp;quot;ka_button small_button&amp;quot; href=&amp;quot;&amp;lt;?php the_permalink() ?&amp;gt;&amp;quot; rel=&amp;quot;bookmark&amp;quot; title=&amp;quot;&amp;lt;?php the_title(); ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;span&amp;gt;&amp;lt;?php echo $ka_blogbutton; ?&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;

To stop the Post Title to link to the Single Post, look in line 58 for this code:

&amp;lt;h2&amp;gt;&amp;lt;a href=&amp;quot;&amp;lt;?php the_permalink(); ?&amp;gt;&amp;quot; title=&amp;quot;&amp;lt;?php the_title(); ?&amp;gt;&amp;quot;&amp;gt;&amp;lt;?php the_title(); ?&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h2&amp;gt;

And change to this:

&amp;lt;h2&amp;gt;&amp;lt;?php the_title(); ?&amp;gt;&amp;lt;/h2&amp;gt;

Use custom excerpt for each Post.

Option #4:

Completely remove and replace: 

&amp;lt;?php limit_content(80,  true, '');

with this:

&amp;lt;?php the_excerpt(); 

Then manually add your custom excerpt for each Post. (make sure you have “excerpt” enabled in “Screen Options”) This up side is that it will give you full control about what to display for each excerpt. The downside is that you would need to manually add a custom excerpt for each post. In Karma 4.0, the code is as follows:

limit_content(80,  true, '');

So you would change it as follows:

the_excerpt();