Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • #3590


    I am new to WordPress theme configuring, but have spent sometime editing the Cleancut theme and have been VERY happy with it. I tried several others from different design groups, but yours is thee best. You have all done an amazing job and your support forum seems really helpful.

    I have my first question/problem that I’m hoping you’ll be able to help me with.

    On my homepage, I’ve set it up so that the two row/four columns below the slider image pull items from my portfolio to feature as ‘Recent Work’, however I am unable to get the category query function to work. I would like each spot to show a different recent portfolio post, chronologically if possible. Instead, it just posts the same two over and over across the four columns.

    Here is the URL to my site for further viewing:

    I read this similar post: (Purchase code hidden if logged out)(Purchase code hidden if logged out) -line

    But wasn’t sure how to implement those changes.

    When I tried entering the category id in the sidebar widget for Cleancut Sidebar News (which I use to populate the front page Portfolio items) with the category id ‘web’, which is what I have set my portfolio items that pertain to web design, it now doesn’t even display it and only shows three columns on my homepage.

    Any help would be greatly appreciated!



    I’ve posted screenshots of my dashboard items pertaining to this question here:



    I wonder if instead of using widgets you be better off modifying the front page to use a custom query to load your different posts.

    The code you’d need to replace is:


    // placeholder content if "display by html" was choosen:

    $placeholder[1] = '<h3>WP Theme CleanCut</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco <a href="">laboris nisi</a> ut aliquip ex ea commodo conse. <a class="more-link" href="#">Read more</a></p>';

    $placeholder[2] = '<h3>Adobe Flash Videos</h3><p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum <strong>dolore eu fugiat</strong> nulla pariatur.<br/> Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<a class="more-link" href="#">Read more</a></p>';

    $placeholder[3] = '<h3>jQuery to the rescue</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo conse.
    quat. <a class="more-link" href="#">Read more</a></p>';

    $placeholder[4] = '<h3>Advanced Backend</h3><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo conse.
    quat. <a class="more-link" href="#">Read more</a></p>';

    // this class generates the 4 boxes, either with backend content or the placeholder content above
    $k_option['mainpage']['mainpage_column'] = 4;
    $boxes = new kclass_display_box('mainpage','mainpage_column','Mainpage Column', $placeholder);
    $boxes-> prev_image($k_option['custom']['imgSize']['M']);
    $boxes-> setClass('one_fourth');
    $boxes-> display();


    and you can use the Testimonial code below this code in the file:

    //query testimonials
    $additional_loop = new WP_Query("post_type=testimonials&posts_per_page=5"); ?>

    //if the query returned any results show the testimonial box
    if($additional_loop->have_posts()) :

    $active[0] = 'active_testimonial';
    $active[1] = 't_slide_active';

    <div class='hr'><a href="#top" class='scrollTop'>top</a></div>
    <div id="testimonial" class='two_third'>
    <div class="quote ie6fix"></div>

    <div class="testimonial_author_pics">

    //displays the portfolio pictures
    while ($additional_loop->have_posts()) : $additional_loop->the_post();
    $img = kriesi_post_thumb( $post->ID, array('size'=> array('S','_testimonial_person'),
    'wh' => $k_option['custom']['imgSize']['S'],
    'img_attr' => array('class'=>'ie6fix'),
    'display_link' => array('none')

    echo "<a href='#' class='".$active[0]."'>".$img."</a>";
    $active[0] = "";
    endwhile; ?>

    <span class='testimonial_arrow ie6fix'></span>
    <!-- end testimonial_author_pics-->

    <div class="testimonial_slides">

    $testimonials = false;
    //display the testimonial content
    while ($additional_loop->have_posts()) : $additional_loop->the_post();
    $testimonials = true;
    $name = get_post_meta($post->ID, "_testimonial_person_name", true);
    $url = get_post_meta($post->ID, "_testimonial_person_url", true);

    $small_prev_image = kriesi_post_thumb( $post->ID, array('size'=> array('SL'),
    'wh' => $k_option['custom']['imgSize']['SL'],
    'img_attr' => array('class'=>'ie6fix'),
    'display_link' => '_testimonial_person_url'

    <div class='t_slide <?php echo $active[1]; $active[1] = ''; ?>'>

    //thumbnail image
    echo "<span class='testimonial_img'>".$small_prev_image."</span>";

    echo "<div class='testimonial_entry'>";
    echo "<strong class='heading'>".get_the_title()."</strong>";
    the_content('

    echo '<strong class="testimonial_author">';
    echo $url != "" ? "<a href='".$url."'>".$name."</a>": $name;
    echo '</strong>';
    echo "</div>";
    <!--end t_slide-->

    <!--end testimonial_slides -->
    <!--end testimonial-->

    as an example Query.

    This would allow you more control over the output.



    Hey James,

    Thanks so much for the response. I have a couple follow-ups to your solution. Admittedly, I know very little about PHP, so please be patient with me as I try to understand.

    1 – I’m assuming these changes would need to take place in the index.php file?

    2 – Do I copy ALL of the code from the second snippet you included above or just a portion to replace with the entire snippet of the first box?

    3 – Will this solution auto-populate the boxes with recent portfolio items or will I have manually be updating it each time I want a new portfolio piece to appear on the front page?

    4 – Will this maintain the same layout as the widget option? (square thumbnail to the left – text to the right, four entries per row, 2 rows)

    Thanks again for your help with this!



    The code I provided was designed to get you started on making your modification and I suggested using a custom bit of code rather than the default meta boxes.

    This would require a working knowledge of WP and there is comprehensive information available in the Codex (

    1.) Yes, this change would be in index.php

    2.) The code I provided is an example. You’d need to copy / paste the code and modify it to suit your needs.

    3.) If you set the query to your portfolio items (this is by default a Custom Post Type) so change my example code query from:

    $additional_loop = new WP_Query("post_type=testimonials&posts_per_page=5");


    `$additional_loop = new WP_Query(“post_type=portfolio&posts_per_page=5”);

    and adjust the posts_per_page to the number of entries you want to show.

    4.) If you change the output to duplicate the default output (but using the portfolio entries as posts) this should behave as per the original code.

    I can guide you but this is a significant modification. If you feel out of your depth you could hire someone to complete this for you – there is a topic over at Theme Forest if you’re looking for someone: (Purchase code hidden if logged out)(Purchase code hidden if logged out) -to-make-some-money/24795

    Hope this helps you in the right direction.



    Hi James,

    Thanks for the follow-up, I have went ahead and put your suggestions into effect and the result is I’m now getting a duplication of the testimonial area that is filling up with my portfolio items. This isn’t the solution I was hoping for, but I appreciate the effort. I was really hoping to maintain the same appearance and functionality of the widgetized posts. In my original edits, it was querying and formatting correctly, but the category filter just wasn’t working properly – which is what I was really hoping to get help on.

    I’ve posted a pic of what occured with your suggested solution, which is viewable here ( to ensure you I’ve attempted to incorporate your suggestions and appreciate your effort. Unfortunately, it’s just not what I was really asking for in my original post of this thread.

    I am mainly trying to understand why the category filter wasn’t working for the meta boxes and remedy that.

    After spending quite a bit of time searching I found the same problem was posed here by someone else: (Purchase code hidden if logged out)(Purchase code hidden if logged out) -items-instead-of-posts

    ‘Dude’ had closed the topic in his last response there, saying he’d posted a modified query code, but I didn’t see the actual code anywhere in that post – which is why I re-posted my similar question.


    bump – still would really love to hear a solution for why the category filter doesn’t work on sidebar_portfolio widget.


    This would be the sidebar widget code that doesn’t seem to be filtering by category correctly:

    /* Add our function to the widgets_init hook. */
    add_action( 'widgets_init', 'kriesi_sidebar_portfolio_widget' );

    /* Function that registers our widget. */
    function kriesi_sidebar_portfolio_widget() {
    global $kriesiaddwidget;
    $kriesiaddwidget = 0;
    register_widget( 'Kriesi_sidebar_portfolio_Widget' );

    class Kriesi_sidebar_portfolio_Widget extends WP_Widget {
    function Kriesi_sidebar_portfolio_Widget()
    $widget_ops = array('classname' => 'community_news', 'description' => 'A Sidebar widget to display posts in your sidebar' );

    $this->WP_Widget( 'community_news', THEMENAME.' Sidebar Portfolio', $widget_ops );

    function widget($args, $instance)
    global $k_option;
    extract($args, EXTR_SKIP);
    echo $before_widget;

    $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
    $count = empty($instance['count']) ? '' : apply_filters('widget_entry_title', $instance['count']);
    $cat = empty($instance['cat']) ? '' : apply_filters('widget_comments_title', $instance['cat']);

    if ( !empty( $title ) ) { echo $before_title . $title . $after_title; };

    if (!empty($cat))

    $array_cat = explode(",", $cat);
    $myquery = array(
    'posts_per_page'=> $count,
    'tax_query' => array(
    'taxonomy' => 'portfolio_entries',
    'field' => 'id',
    'terms' => $array_cat ,
    'operator' => 'IN'


    $myquery = 'post_type=portfolio&taxonomy=portfolio_entries&posts_per_page='.$count;


    $additional_loop = new WP_Query($myquery);
    if($additional_loop->have_posts()) :
    while ($additional_loop->have_posts()) : $additional_loop->the_post();

    $small_prev = kriesi_post_thumb($post->ID, array('size'=> array('S'),
    'display_link' => array('permalink'),
    'wh' => $k_option['custom']['imgSize']['S'],
    'img_attr' => array('class'=>'rounded alignleft'),
    'link_attr' => array('class'=>'alignleft preloading_background')

    <div class="entry box_entry">
    <a>" rel="bookmark" title="<?php _e('Permanent Link:','cleancut')?> <?php the_title(); ?>">
    <?php the_title(); ?>

    if($small_prev) echo $small_prev;
    the_excerpt('Read more'); ?>


    echo $after_widget;


    function update($new_instance, $old_instance)
    $instance = $old_instance;
    $instance['title'] = strip_tags($new_instance['title']);
    $instance['count'] = strip_tags($new_instance['count']);
    $instance['cat'] = strip_tags($new_instance['cat']);
    return $instance;

    function form($instance)
    $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'count' => '', 'cat' => '' ) );
    $title = strip_tags($instance['title']);
    $count = strip_tags($instance['count']);
    $cat = strip_tags($instance['cat']);
    <p><label for="<?php echo $this->get_field_id('title'); ?>">Title:
    <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>

    <p><label for="<?php echo $this->get_field_id('count'); ?>">How many entries do you want to display:
    <input class="widefat" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" type="text" value="<?php echo attribute_escape($count); ?>" /></label></p>

    <p><label for="<?php echo $this->get_field_id('cat'); ?>">Enter the ids of the categories you want to display, separate them by comma:
    <input class="widefat" id="<?php echo $this->get_field_id('cat'); ?>" name="<?php echo $this->get_field_name('cat'); ?>" type="text" value="<?php echo attribute_escape($cat); ?>" /></label></p>



    Please. I realize I am probably being buried by support in hopes of disappearing. I paid for this theme, and I’ve asked one support question and was provided a solution that didn’t match my inquiry or desired intent. I don’t think I’m being out of line by asking for clarification. I’ve even tried to help others needing support. Again, Dude alluded to the fact that there was a solution for this in another poster’s thread – but the solution itself wasn’t listed there. If there is no solution, you can simply say that and I’ll quit checking back here every hour in hopes that someone will answer me.



    I can’t find an obvious reason why it doesn’t work – I’d need more time to investigate it. You can try to adjust the portfolio query as James suggested above or you can try to duplicate the query code for every column and hardcode the categories. However as far as I know CleanCut doesn’t come with a portfolio widget – the query code is a customization and we can only support customizations if they’re not time intensive.

    I’m sorry but I think this is beyond the scope of this support forum. I can only offer my help on a freelancer basis….


    First, thank you very much for responding Dude. I appreciate your time and input. I completely understand this is beyond the scope of the support forum, and portfolio widgets aren’t included with the theme. However, would you mind revisiting your original thread regarding this same question someone else had posted? (Purchase code hidden if logged out)(Purchase code hidden if logged out) -items-instead-of-posts

    That is where you first offered a portfolio widget as a modification. Your final response, you’d said you’d figured out the problem with the category filter not working – but the solution wasn’t listed. I’m wondering if you still recall what the solution was?

    Also, can I email you directly to discuss the freelance assistance on this?

    Many thanks.


    I posted the update in the first post. The original code used:

    $additional_loop = new WP_Query("cat=".$cat."&posts_per_page=".$count);

    as query — the code I posted afterwards is the solution to the category query problem. However it’s possible that CleanCut needs a different query.

    You can send me the mail to: (Email address hidden if logged out) and I’ll make you a quote.

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

The topic ‘Portfolio widget problem on homepage’ is closed to new replies.