Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 170

Home Forums Theme Support Charity Getting Blog Masonry page to show posts of just one category


Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #4235

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi there,

    I’m trying to only show posts of category 17 on our blog page, which uses the Blog Masonry Page Template. I’ve tried a few different things, but nothing is working. Can you help?

    Thanks,

    Brian

    #4250

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hey,

    Try this:

    Go to the theme’s folder and edit the file named “blog-masonry.php”. On line 18, just after this:

    'post_status' => 'publish',

    paste this:

    'cat' => '17',

    Save. Done.

    Let me know how’s going.

    Cheers!
    Chris

    #4255

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    That worked, thanks. Is there a way to get the “Recent Posts” widget to also only show posts from one category? Thanks.

    #4279

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hey,

    You’ll need to edit the file named “recent-posts.php” located in the theme’s folder > framework > inc > widgets.

    At line 41, just before this: showposts= add the same line but like this:

    cat=17&

    The whole line should look like this:

    'cat=17&showposts='.$instance['postcount'].''

    Save. Done.

    Cheers!

    #4308

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi,

    Sadly, that didn’t do it. Here is what my code looks like:

    <?php
    $recent_posts = new WP_Query();
    $recent_posts->query(‘cat=17&showposts=’.$instance[‘postcount’].”);
    while ($recent_posts->have_posts()) : $recent_posts->the_post(); ?>

    Any suggestions on how to just get the Recent Posts widget to only show posts from category 17? Thanks!

    Brian

    #4323

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hey,

    I’m seeing an error in your code:

    β€˜cat=17&showposts=’.$instance['postcount'].”

    At the end of the line you have a double quotes instead of two single ones.

    It should look like this:

    'cat=17&showposts='.$instance['postcount'].''

    Cheers!

    #4328

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Hi,

    I’ve made that fix. Still no luck. The Recent Posts widget still shows all categories of posts. Here is the full widget code (of which, I have only changed the line you recommended.) Thx.

    <?php
    /*
    Plugin Name: Recent Posts Widget
    Plugin URI: https://skat.tf/
    Description: A simple widget to display the recent posts.
    Version: 1.00
    Author: Skat
    Author URI: https://skat.tf/
    */

    // The widget class
    class sd_recent_posts_widget extends WP_Widget {

    // Widget Settings
    function sd_recent_posts_widget() {

    $widget_ops = array( ‘classname’ => ‘sd_recent_posts_widget’, ‘description’ => __(‘A widget to display the recent posts.’, ‘sd-framework’) );
    $control_ops = “”;
    $this->WP_Widget( ‘sd_recent_posts_widget’, __(‘Recent Posts’, ‘sd-framework’), $widget_ops, $control_ops );
    }

    // Widget Output
    function widget($args, $instance) {
    extract($args);
    $title = apply_filters(‘widget_title’, $instance[‘title’]);

    // Before the widget
    echo $before_widget;

    // Display the widget title if one was input
    if ( $title )
    echo $before_title . $title . $after_title;

    // Display the Feedburner subscribe form
    ?>

    <div class=”popular-posts”>

      <?php
      $recent_posts = new WP_Query();
      $recent_posts->query(‘cat=17&showposts=’.$instance[‘postcount’].”);
      while ($recent_posts->have_posts()) : $recent_posts->the_post(); ?>
      <li class=”clearfix”>
      <?php if ( (function_exists(‘has_post_thumbnail’)) && (has_post_thumbnail()) ) : /* if post has post thumbnail */ ?>
      <div class=”popular-post-thumb”>
      <figure>
      <?php the_post_thumbnail(‘recent-blog’); ?>
      </figure>
      </div>
      <!–image–>
      <?php endif; ?>
      <div class=”popular-posts-content”>
      <h4>” title=”<?php the_title(); ?>”>
      <?php the_title(); ?>

      </h4>
      <p><?php echo substr(get_the_excerpt(), 0, 55); ?></p>
      <span class=”popular-date”> <?php echo get_the_date( get_option(‘date_format’) ); ?> </span> <span class=”popular-comments”>,
      <?php comments_popup_link( ‘0 comments’, ‘1 comment’, ‘% comments’, ‘comments-link’, ‘comments closed’); ?>
      </span> </div>
      <!–details–>

      <?php endwhile; ?>
      <?php wp_reset_query(); ?>

    </div>
    <?php
    // After the widget
    echo $after_widget;
    }
    // Update the widget
    function update( $new_instance, $old_instance ) {
    $instance = $old_instance;
    $instance[‘title’] = strip_tags( $new_instance[‘title’] );
    $instance[‘postcount’] = strip_tags( $new_instance[‘postcount’] );

    return $instance;
    }

    // Widget panel settings
    function form( $instance ) {

    // Default widgets settings
    $defaults = array(
    ‘title’ => ‘Recent Posts’,
    ‘postcount’ => ‘3’
    );
    $instance = wp_parse_args( (array) $instance, $defaults ); ?>

    <!– Widget Title: Text Input –>
    <p>
    <label for=”<?php echo $this->get_field_id( ‘title’ ); ?>”>
    <?php _e(‘Title:’, ‘sd-framework’) ?>
    </label>
    <input class=”widefat” type=”text” id=”<?php echo $this->get_field_id( ‘title’ ); ?>” name=”<?php echo $this->get_field_name( ‘title’ ); ?>” value=”<?php echo $instance[‘title’]; ?>” />
    </p>

    <!– Post Count: Text Input –>
    <p>
    <label for=”<?php echo $this->get_field_id( ‘postcount’ ); ?>”>
    <?php _e(‘Post Count’, ‘sd-framework’) ?>
    </label>
    <input class=”widefat” type=”text” id=”<?php echo $this->get_field_id( ‘postcount’ ); ?>” name=”<?php echo $this->get_field_name( ‘postcount’ ); ?>” value=”<?php echo $instance[‘postcount’]; ?>” />
    </p>
    <?php
    }
    }
    // Register and load the widget
    function sd_recent_posts_widget() {
    register_widget( ‘sd_recent_posts_widget’ );
    }
    add_action( ‘widgets_init’, ‘sd_recent_posts_widget’ );
    ?>

    #4329

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    That’s weird. I’ve just made a test on my demo page and it’s definitely working like this.

    I’ve made a version for you. Just replace the whole file name with the one inside the attached archive.

    Let me know how’s going.

    Cheers!

    #4331

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    I replaced the old file with the one you provided… and it still is not working. Attached is a screenshot of my Recent Posts, showing category 23 posts still showing up with category 17 posts.

    I then fully deleted the recent-posts.php file from the server… and did a clean upload of your new file just to make sure it wasn’t user error… and the problem persists.

    #4335

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    skat
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    Are you sure that those articles are not in both categories 17 & 23?

    Cheers!

    #4343

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    I wish it were that easy πŸ™‚ Attached is a screenshot showing one of the posts is selected as ‘Share Your Story’ (category 23) and not selected as ‘News’ (Cat 17). Since these are the only two categories I am using, should we try code to exclude category 23 instead?

    #4345

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 657

    Warning: range(): Argument #1 ($start) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658

    Warning: range(): Argument #2 ($end) must be a single byte, subsequent bytes are ignored in /home/skattf/public_html/wp-content/plugins/buddypress-first-letter-avatar/buddypress-first-letter-avatar.php on line 658
    getmebrian
    Warning: Attempt to read property "supported_until" on string in /home/skattf/public_html/wp-content/themes/helpdesk/core/libraries/vendors/bbpress/init.php on line 109

    I figured it out. There are two Recent Posts widgets (see attached screenshot)… and I wasn’t using the one you custom configured. Once I swapped them, it works. Thanks… any chance you can take a look at my other post titles “Changing the yellow “Donate Now” button”? Thanks again!

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.