Forums › Forums › Search & Filter Pro › Variable in results.php
- This topic has 15 replies, 2 voices, and was last updated 5 years, 7 months ago by Trevor.
-
Anonymous(Private) January 16, 2019 at 9:37 am #199075
Hi there. I´m getting well a variable ($textobt) in results.php loop, but when I apply a filter or I when I get more results when scroll the page, I can’t ge the variable.
This is my code
<div class="search-filter-results-list"> <div class="row"> <?php $textobt = get_field('texto_boton'); ?> <?php while ($query->have_posts()) { $query->the_post(); ?> <article class="search-filter-result-item col-xs-6 col-sm-3 col-lg-2 item-n"> <div class="item-espectaculo"> <?php the_post_thumbnail('thumbnail', array('class' => 'item-img'), [ 'alt' => esc_html ( get_the_title() ) ]);?> <div class="item-container"> <div class="ciudad"><img />/images/icon-position.png" height="13" class="icon-pos"><?php the_field('ciudad'); ?></div> <h1><?php the_title(); ?></h1> <div class="item-fechas"><?php the_field('desde'); ?> - <?php the_field('hasta'); ?></div> <div class="sep-info"></div> <!-- <div class="item-preciodesde">Desde <span class="carga-precio">0</span>€</div> --> <button type="submit" onclick="window.location.href = '<?php the_field('url_espectaculo'); ?>';" class="btn btn-primary btn-lg btn-block bt-item"><?php echo $textobt; ?></button> </div> </div> </article> <?php } ?> </div> </div>
And this is my site: https://eventos.entradas.com/
Thanks.
Trevor(Private) March 26, 2019 at 12:27 pm #206279I understand what you are doing now, and what is wrong. I have changed the code in your results file. For now I have commented out sections of your code, on lines 33 and 50 and added fetching the ACF value in line 50, with the addition of the page ID for the home page in the argument.
-
AuthorPosts