*

Daniel PM

  • ****
  • 111 posts
Location on main page
« on: May 02, 2017, 10:44:07 PM »
Hi frosticek, I would like to know wich file can I modify in order to add the city to the inferior part of each 'latest item' shown in main page, just in case the user don't select 'location' filter. Let me send you an image to explain myself better.

Thanks in advance  ;D



Daniel PM

*

MB Themes

Re: Location on main page
« Reply #1 on: May 03, 2017, 03:34:00 PM »
@DanielPM
Listings are generated in:
loop-single.php
loop-single-premium.php
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on May 09, 2017, 12:35:34 PM
*

Daniel PM

  • ****
  • 111 posts
Re: Location on main page (solved)
« Reply #2 on: May 08, 2017, 12:01:19 AM »
This is the answer I was expecting....Try adding it up to the next Zara theme update as an option, it will increase the theme value.


loop-single.php

locate

Code: [Select]
<?php if(osc_count_item_resources()) { ?>
          <?php if(osc_count_item_resources() == 1) { ?>
            <a class="img-link" href="<?php echo osc_item_url(); ?>"><img class="lazy" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" /></a>
          <?php } else { ?>
            <a class="img-link" href="<?php echo osc_item_url(); ?>">
              <?php for ( $i 0osc_has_item_resources(); $i++ ) { ?>
                <?php if($i <= 1) { ?>
                  <img class="lazy link<?php echo $i?>" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" />
                <?php ?>
              <?php ?>
            </a>
          <?php ?>
        <?php } else { ?>
          <a class="img-link" href="<?php echo osc_item_url(); ?>"><img class="lazy" src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" data-original="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" /></a>
        <?php ?>

and replace for

Code: [Select]
<?php if(osc_count_item_resources()) { ?>
          <?php if(osc_count_item_resources() == 1) { ?>
            <a class="img-link" href="<?php echo osc_item_url(); ?>"><img class="lazy" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html

(osc_item_title()); ?>
" alt="<?php echo osc_esc_html(osc_item_title()); ?>" /></a>
<span><?php echo osc_item_city(); ?></span>
  <?php } else { ?>
            <a class="img-link" href="<?php echo osc_item_url(); ?>">
              <?php for ( $i 0osc_has_item_resources(); $i++ ) { ?>
                <?php if($i <= 1) { ?>
                  <img class="lazy link<?php echo $i?>" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php 

echo osc_esc_html(osc_item_title()); ?>
" />
                <?php ?>
              <?php ?>
            </a>
            <span><?php echo osc_item_city(); ?></span>
          <?php ?>
        <?php } else { ?>
          <a class="img-link" href="<?php echo osc_item_url(); ?>"><img class="lazy" src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" data-original="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>"

title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" /></a>
<span><?php echo osc_item_city(); ?></span>
        <?php ?>

************************************************************************************************

loop-single-premium.php

locate


Code: [Select]
<?php if(osc_count_premium_resources()) { ?>
          <?php if(osc_count_premium_resources() == 1) { ?>
            <a class="img-link" href="<?php echo osc_premium_url(); ?>"><img class="lazy" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html

(osc_premium_title()); ?>
" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" /></a>
                <?php } else { ?>
            <a class="img-link" href="<?php echo osc_premium_url(); ?>">
              <?php for ( $i 0osc_has_premium_resources(); $i++ ) { ?>
                <?php if($i <= 1) { ?>
                  <img class="lazy link<?php echo $i?>" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_premium_title()); ?>" alt="<?php 

echo osc_esc_html(osc_premium_title()); ?>
" />
                <?php ?>
              <?php ?>
            </a>
            <?php ?>
        <?php } else { ?>
          <a class="img-link" href="<?php echo osc_premium_url(); ?>"><img class="lazy" src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" data-original="<?php echo osc_current_web_theme_url('images/no-image.png'); ?

>
" title="<?php echo osc_esc_html(osc_premium_title()); ?>
" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" /></a>
        <?php ?>


and replace for this:


Code: [Select]
<?php if(osc_count_premium_resources()) { ?>
          <?php if(osc_count_premium_resources() == 1) { ?>
            <a class="img-link" href="<?php echo osc_premium_url(); ?>"><img class="lazy" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html

(osc_premium_title()); ?>
" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" /></a>
                <span><?php echo osc_premium_city(); ?></span>
          <?php } else { ?>
            <a class="img-link" href="<?php echo osc_premium_url(); ?>">
              <?php for ( $i 0osc_has_premium_resources(); $i++ ) { ?>
                <?php if($i <= 1) { ?>
                  <img class="lazy link<?php echo $i?>" src="<?php echo osc_resource_thumbnail_url(); ?>" data-original="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_premium_title()); ?>" alt="<?php 

echo osc_esc_html(osc_premium_title()); ?>
" />
                <?php ?>
              <?php ?>
            </a>
            <span><?php echo osc_premium_city(); ?></span>
          <?php ?>
        <?php } else { ?>
          <a class="img-link" href="<?php echo osc_premium_url(); ?>"><img class="lazy" src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" data-original="<?php echo osc_current_web_theme_url('images/no-image.png'); ?

>
" title="<?php echo osc_esc_html(osc_premium_title()); ?>
" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" /></a>
<span><?php echo osc_premium_city(); ?></span>
        <?php ?>

Works like a charm.

Courtesy of Magnettoo (Osclass Full Member)
« Last Edit: August 06, 2017, 09:14:34 PM by Daniel PM »
Daniel PM