Home › Forums › WordPress Themes – Premium › Sleeky Pro › Recent Portfolio Widget
I would like to reverse the order of the portfolio posts displayed in the Sleeky Recent Portfolio widget. I changed the order (DESC to ASC) in the portfolio_shortcodes.php file, but that didn’t seem to do it. Where can I find the code to make this change?
function style_portfolio_render($total) {
$args1 = array(
‘posts_per_page’ => $total,
‘category’ => ”,
‘category_name’ => ”,
‘orderby’ => ‘post_date’,
‘order’ => ‘ASC’,
‘include’ => ”,
‘exclude’ => ”,
‘paged’ => $paged,
‘meta_key’ => ”,
‘meta_value’ => ”,
‘post_type’ => ‘style_portfolio’,
‘post_mime_type’ => ”,
‘post_parent’ => ”,
‘post_status’ => ‘publish’,
‘suppress_filters’ => true );
$my_posts = get_posts( $args1 );
?>
I also added the order=asc to sleeky_latest_portfolio.php
//echo do_shortcode(‘[portfolio columns=3 showposts=6]’);
echo ‘</div>’;
} else {
echo do_shortcode(‘[portfolio order=asc columns=3 showposts= ‘.get_theme_mod( ‘sleeky_number_portfolio’, 6).’]’);
}
echo ‘</div>’;
Neither seem to change anything.
Hi Ellen,
Thank you for contacting Styled Themes support team. To change the order of portfolio post of Sleeky Recent Portfolio widgets you need to do certain customization on sleeky_latest_portfolio.php[ site_folder\wp-content\themes\sleeky-pro\sleeky_includes\widgets\skeeky_latest_portfolio.php ]. There you need to change wp_query argument to something like this:
$args = array( 'post_type' => 'portfolio', 'posts_per_page' => 6, 'paged' => $paged, 'order' => 'ASC' );
Note: As this widgets file is not template file , you can’t customize on child theme . To customize on child theme you need to create another widgets. So you changes will not lost on theme update.
Let us know how it will goes,
Thanks
Thanks Binaya, that worked great!
Hi Ellen,
You are welcome, if you face any problem in future then please let us know. We are happy to help you.
Thanks
With our premium themes, we offer access to site documentation, video tutorials and timely support. Even if you have just started on WordPress, our support staff have the patience to help you create appealing sites gracefully.
Company
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.To find out more, including how to control cookies, see here: Privacy Policy
© Copyright © 2023 Styled Themes. All Right Reserved.