• Greetings.
    I have a doubt, My customer wants that, for each certain number of results, it comes a row of featured ones.

    I could set

    [adverts_list category=”my category”]
    [adverts_list category=”my category” list_type=”featured”]
    [adverts_list category=”my category”]

    But what puts me thinking is (for example) if each 3 rows (3 columns), or 9 items display from 1 to 9, then 3 featured, then 10 to 18, and so on.

    Can be done a kind of override to display those items that way? Not quantity.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    hmm by default this is not really possible with WPAdverts, what you would need to do is create a child template file for wpadverts/templates/list-item.php as explained here https://wpadverts.com/documentation/child-themes-and-templates/

    Then your custom list-item.php should have something like this

    
    <?php
    global $ad_index;
    if( $ad_index = null ) {
      $ad_index = 1;
    }
    
    if( $ad_index % 3 == 0 ) {
      echo "<div>[FEATURED AD]</div>";
    }
    
    include_once ADVERTS_PATH . "/templates/list-item.php";
    $ad_index++;
    ?>
    

    What this will do is display a featured Advert every 3 ads (you need to customize this code echo "<div>[FEATURED AD]</div>"; to load a featured Ad and display it).

    Note that if you will set posts_per_page to 10, then the actual number of Ads will be between 10 and 13 depending on how many featured Ads you have.

    Thread Starter johndoe01

    (@johndoe01)

    OK, with the template override i got it clear, even i could do a variation of the trick i did for the layout customization.

    One more thing: How can i set than the main list does not show the featured ads, so i can place those featured ads in the rows i need to set? If is not plausible such mix, the only thing i’d need is hide the featured ads on the list so I can show them on their dedicated section.

    Thanks for the answer

    Plugin Author Greg Winiarski

    (@gwin)

    To do that you can use the [adverts_list] with list_type param to ignore the featured ads

    
    [adverts_list list_type="normal"]
    

    Please see https://wpadverts.com/documentation/creating-ads-list-adverts_list/ for more details.

    Thread Starter johndoe01

    (@johndoe01)

    Thanks. The normal listing is what i’m looking.
    However my only pending is the inserts when a row / ad number is reached but now i have a base of where to begin with.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Split Displayed Results?’ is closed to new replies.