Knowledgebase

How to Increase the post count limit in the Content Widget

Intro

In an HTML editor on your computer, open the ocmx/widgets/content-widget.php Change the class name on lines 2, 4 and the last line. The class name is highlighted in the following example, and a unique version can be as simple as my_feature_posts_widget: class obox_content_widget extends WP_Widget { /** constructor */ function obox_content_widget() { And on the […]

Solution

  1. In an HTML editor on your computer, open the ocmx/widgets/content-widget.php
  2. Change the class name on lines 2, 4 and the last line. The class name is highlighted in the following example, and a unique version can be as simple as my_feature_posts_widget:
    class obox_content_widget extends WP_Widget {
    /** constructor */
    function obox_content_widget() {

    And on the last line:

    add_action('widgets_init', create_function('', 'return register_widget("obox_content_widget");'));
  3. Save the file with a unique filename, such as mycontent-widget.php
  4. Scroll down to the bottom to locate line 252 and change 13 to your desired cap:
     <?php $i = 1;
     while($i < 13) :?>
  5. Save again and upload to wp-content/themes/yourtheme/ocmx/widgets using an FTP client or your hosting control panel.

If you plan to make other modifications, consider using a child theme to make managing theme updates and your mods easier:

How to Create a Barebones Child Theme for Obox Themes

Get 15% off!

Signup and get 15% off any of our Ghost or Framer themes immediately