Close

Account

Documentation

Forum

Menu

Sidebar & Top Slider help

  • Post count: 5
    Freddy
    August 1, 2016 at 8:35 pm #21470

    Hi, Thank you for your reply on envato. I got the main sidebar to show the latest reviews as well but it doesn’t show the star rating or the category like the review page sidebar. I was wondering you you could point me in the right direction to enabling that on the main sidebar.

    Main Sidebar – https://goo.gl/photos/ZUHTpQQKq4N7F7tM7
    Review Sidebar- https://goo.gl/photos/pvinVVfuFbQMnLsq8

    Also, is there a way to also show reviews in the jmagz top slider on the home page?

    Thank you.

    • This topic was modified 1 year ago by  Freddy.
    Post count: 2238
    Jegbagus
    August 3, 2016 at 2:13 am #21495

    hi Freddy, to implement this kind of change, you will need a custom change. i can direct you, but you will need to do it your self. go to jmagz themes folder > lib > ajax-response.php on line 192, you have function jeg_feed_do_query. You will need to modify this one. you can take a look at this function “jeg_review_feed_do_query”. it generate rating.

    Thank you

    Post count: 5
    Freddy
    August 6, 2016 at 12:43 am #21526

    I added the reviews to the sidebar and their starrating, however, the stars also show up on the posts and I have been trying to get rid of them but have’t had any luck. I was wondering if you could help me. My code is highlighted below.

    https://goo.gl/photos/FDoaDCCYzBeBTevx9
    https://goo.gl/photos/2voBV52e5uq62juB6

    Thanks again!

    Post count: 2238
    Jegbagus
    August 6, 2016 at 2:38 am #21528

    hi freddy, you will need to check if your post type is a review or not. you can use this code :

    Thank you

    Post count: 5
    Freddy
    August 26, 2016 at 12:30 am #21776

    Hi, sorry to bother you again. I don’t know exactly how to use this code in the ajax response under jeg_feed_do_query. I’ve tried many different ways but I’ve failed and wanted to ask if you could help me. My code is below.

    <pre class=”lang:default decode:true ” >function jeg_feed_do_query($query, $active = ”) {
    $recentfeed = ”;
    $index = 0;
    $enablesidefeedads = vp_option(‘joption.enable_sidefeed_ads’, 0);
    $sidefeedorder = vp_option(‘joption.sidefeed_ads_order’, 3);

    if ( $query->have_posts() ) {
    while ( $query->have_posts() )
    {

    if($enablesidefeedads && $index == $sidefeedorder) {
    $recentfeed .= “<div class=’sidebar-post-item sidebar-promotion clearfix’>” . jeg_render_ads(‘sidefeed_ads’) . “</div>” ;
    }
    $query->the_post();
    $categoryarray = get_the_category();
    $categoryarrayreview = get_the_terms(get_the_ID(), ‘review-category’);
    $categorytext = $timeformat = ”;

    if(!empty($categoryarray)) {
    $categorytext = “<span class=’post-category’>term_id) . “‘ rel=’category’>” . $categoryarray[0]->name . “</span>”;
    }

    /** Code I added **/

    if(!empty($categoryarrayreview)) {
    foreach($categoryarrayreview as $cat) {
    $categorytext = “<span class=’post-category’>term_id, ‘review-category’) . “‘ rel=’category’>” . $cat->name . “</span>”;
    }
    }

    /** End code **/

    if(vp_option(‘joption.sidebar_date’) === ‘dateago’) {
    $timeformat = “<time class=’post-date’ datetime='” . get_the_time(“Y-m-d H:i:s”) . “‘>” . human_time_diff( get_the_time(‘U’), current_time(‘timestamp’) ) . __(‘ ago’, ‘jeg_textdomain’) . “</time>”;
    } else {
    $timeformat = “<time class=’post-date’ datetime='” . get_the_time(“Y-m-d H:i:s”) . “‘>” . get_the_time(“F j, Y “) . “</time>”;
    }

    $mean = get_post_meta(get_the_ID(),’rating_mean’);
    $starrating = apply_filters(‘jeg_build_rating’, null, $mean);;

    $formatclass = jeg_format_post();
    $recentfeed .=
    “<div class='” . $active . ” sidebar-post-item clearfix ” . $formatclass . “‘ data-id='” . get_the_ID() . “‘>
    ” . apply_filters(‘jeg_featured_figure_lazy’, null, ‘square-thumbnail’, null, ‘ajax’) . ”
    <div class=’content’>
    <h3 class=’post-title’>” . get_the_title() . “</h3>

    /** Code added to make stars appear **/

    ” . $starrating . ”

    /** End code **/
    <footer class=’post-meta’>
    ” . $categorytext . $timeformat . ”
    </footer>
    </div>
    </div>”;
    $index++;
    }
    }
    return $recentfeed;
    }

    Post count: 2238
    Jegbagus
    August 30, 2016 at 3:12 am #21798

    hi Freddy, i unable to understand code that you provide to me. may i know what you want to achieve?

    Post count: 5
    Freddy
    September 1, 2016 at 5:55 am #21808

    I added review posts to the homepage sidebar, then I added the review stars underneath but it also showed review stars on both news post and review posts. You gave me some php code (in the comments above) to only show review stars on the review posts in the sidebar, but I just don’t know where/how to use it. I’ve tried and failed.

    Also, do you guys plan on making the width of the content wider in the next update?

    Post count: 2238
    Jegbagus
    September 1, 2016 at 6:23 am #21812

    i don’t really get your code. but code to showing rating is very simple.

    it will show your rating star.

    Thank you

You must be logged in to reply to this topic.