*

Decent Gull

  • *
  • 4 posts
No. of ads to show on home page from custom category
« on: May 28, 2020, 03:03:24 AM »
Hi everyone..

I have a code working very well provided by mb themes in this forum in "latest items block" in main.php

The code is...

Code: [Select]
<div class="home-container latest">
    <div class="inner">

      <!-- LATEST LISTINGS BLOCK -->
      <div id="latest" class="products grid">
        <h2><?php _e('Lately added on our classifieds''beta'); ?></h2>

        <?php osc_query_item(array("category" => "4")); ?>

        <?php if( osc_count_custom_items() > 0) { ?>
          <div class="block">
            <div class="prod-wrap">
              <?php $c 1?>
              <?php while( osc_has_custom_items() ) { ?>
                <?php bet_draw_item($c); ?>
               
                <?php $c++; ?>
              <?php ?>
            </div>
          </div>
       
        <?php } else { ?>
          <div class="home-empty">
            <img src="<?php echo osc_current_web_theme_url('images/home-empty.png'); ?>" />
            <strong><?php _e('No listing in category yet''beta'); ?></strong>
          </div>
        <?php ?>

        <?php View::newInstance()->_erase('items') ; ?>
      </div>
    </div>
  </div>

This is very good.. Thanks MB themes.. I need a little bit more in this code.

1. How i can show only 8 custom items of selected category?
 
(i.e i want show only 8 items of category 4.....

But this query show all items in category 4
<?php osc_query_item(array("category" => "4")); ?>

2. How to show the latest items on top from category 4 if the number of items will be select to 8?

If anybody now it... Pls tell me..



*

MB Themes

Re: No. of ads to show on home page from custom category
« Reply #1 on: May 28, 2020, 09:23:02 AM »
@Decent Gull
Thanks for sharing ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Decent Gull

  • *
  • 4 posts
Re: No. of ads to show on home page from custom category
« Reply #2 on: May 30, 2020, 07:44:12 AM »
Thanks everybody. I found it my self