Forums Forums Search Search Results for 'get_field('

Viewing 10 results - 21 through 30 (of 90 total)
  • Author
    Search Results

  • Anonymous
    Inactive

    The plugin doesn’t use get_post_meta function, it retrieves data by using the ACF API (actions and filters) and ACF get_field(). There is no data saved in the wp_postmeta table.
    That’s why I was thinking of intercepting the WP_Query somehow…


    Anonymous
    Inactive

    Hello,

    I am using ACF Custom Database Tables plugin that creates custom tables for ACF custom meta data. ACF Custom Database Tables uses ACF’s core API functions – get_field() and update_field() – to store/retrieve data from custom tables.

    The fields for the Custom Post Type are created as usual with ACF, but then the plugin saves the data in a custom table, outside the normal WP post meta table.

    I was wondering if I can use the SF Pro plugin for searching and filtering this custom table, maybe by altering the WP_Query?
    The custom fields do not appear in the Post Meta table at all, and also not in the SF post meta search field.

    Regards!

    #230042

    Anonymous
    Inactive

    Hi Trevor, thanks for your quick thought.
    Yes,both settings for auto count are set to on.
    Hide empty is only for “choise” fields, and the first two settings are number fields. Hide empty is set to on for the third field.

    – Can it have something to do with the fact that I use 3 wp-queries?
    – I don’t see any effect from adding 'search_filter_id' => 153395, to the $args. How can I check if this is set right?

    Please see this page, where the only offer should disappear when the first filter is set to less than 3: https://fietspitstop.nl/product/yepp-fietszitje-achter-maxi-easyfit-achter-zwart/

    This is the most recent template code:

    <?php
    /*
     * Template Name: Product
     * Template Post Type: post, page, product, item
    */
    
    get_header(); ?>
    
    <?php
    $link = get_post_custom_values("link") [0];
    
    $color = get_post_custom_values("kleur") [0];
    //echo get_post_custom_values("product_group")[0];
    
    ?>
    
    <div id="content" class="site-content">
    	<section id="primary" class="content-area">
    		<main id="main" class="site-main">
    			<article id="post-2" class="post-2 page type-page status-publish hentry entry">
    			<div class = "pdp-full-top">
    			    <div class = "pdp-top-container entry-header">
    				<h1 class = "pdp-title">
    					<?php
    $brand = get_post_custom_values("brand") [0];
    $line = get_post_custom_values("line") [0];
    $type = get_post_custom_values("type") [0];
    $variant = get_post_custom_values("variant_value") [0];
    echo $brand . " " . $line . " " . $type . " " . $variant;
    ?>
    				</h1>
    				<div class = "pdp-image-container"><div class = "pdp-image-helper"></div><?php the_post_thumbnail(); ?>
    				</div>
    				<div class = "pdp-top-info-container">
    					<h2 class = "pdp-sub-title">
    						<?php
    $product_group = get_the_terms( get_the_ID(), 'productgroep' )[0]->name ;
    echo $product_group . ", " . $variant;
    ?>
    					</h2>
    					<h5 class = "pdp-choise-criteria">Keuzecriteria</h5>
    					<div class = "pdp-price">Prijs vanaf ...
    					</div>
    				</div>
    			    </div>
    			</div>
    			<div class = "pdp-lister-container entry-content">
    			<?php //Filter area ?>
    				<div class = "pdp-filter-container">
    					<?php echo do_shortcode('[searchandfilter id=""]'); ?>
    					<?php echo do_shortcode('[searchandfilter id="153395"]'); ?>
    				</div>
    				<div class = "pdp-shopping-list-container">
    					<?php
    //Get all merchants
    $ean = get_field("ean");
    $args_merchants = array(
        'post_type' => 'merchant_offer',
        'tax_query' => array(
            array(
                'taxonomy' => 'ean',
                'field' => 'slug',
                'terms' => $ean,
                'compare' => '='
            ) ,
        )
    );
    $offers = new WP_Query($args_merchants);
    $all_merchants = [];
    while ($offers->have_posts()):
        $offers->the_post();
        $get_merchant = get_post_meta(get_the_ID() , 'merchant_id') [0];
        array_push($all_merchants, $get_merchant);
    endwhile;
    
    echo "all merchants: ";
    print_r($all_merchants);
    
    //Get filtered merchants
    //wp_reset_postdata();
    //wp_reset_query();
    $args_offers = array(
        'post_type' => 'merchants',
        'search_filter_id' => 153395,
        'tax_query' => array(
            //'relation' => 'AND',
            array(
                'taxonomy' => 'merchant_id',
                'field' => 'slug',
                'terms' => $all_merchants,
                'operator' => 'IN',
            ) ,
        )
    );
    
    $query2 = new WP_Query($args_offers);
    
    $filtered_merchants = [];
    $post_id_by_merchant = [];
    
    while ($query2->have_posts()):
        $query2->the_post();
        $get_filtered_merchant = get_post_meta(get_the_ID() , 'merchant_id') [0];
        array_push($filtered_merchants, $get_filtered_merchant);
        $post_id_by_merchant[$get_filtered_merchant] = get_the_ID();
    
    endwhile;
    //Get filtered offers by filtered merchants
    //wp_reset_postdata();
    //wp_reset_query();
    $args_filtered_offers = array(
        'post_type' => 'merchant_offer', //add filter id somewhere here!
        //'search_filter_id' => 165176,
        'tax_query' => array(
            'relation' => 'AND',
            array(
                'taxonomy' => 'ean',
                'field' => 'slug',
                'terms' => $ean,
            ) ,
            array(
                'taxonomy' => 'merchant_id',
                'field' => 'slug',
                'terms' => $filtered_merchants,
            ) ,
        ) ,
    );
    
    $query3 = new WP_Query($args_filtered_offers);
    //Build shopping list
     ?>
    						<div class = "pdp-shopping-list" id = "pdp-shopping-list">
    <br><?php
    echo "filtered merchants: ";
    print_r($filtered_merchants);
    ?>
    <br><?php
    echo "query 2: ";
    print_r($query2);
    ?>
    							<div class = "row header">
    								<div class = "item"></div>
    								<div class = "item">Winkel</div>
    								<div class = "item">Reviews</div>
    								<div class = "item">Basisprijs</div>
    								<div class = "item">Totaalprijs</div>
    								<div class = "item"></div>
    							</div>
    						<?php if ( have_posts() ) : while ($query3->have_posts()):
        $query3->the_post();
        setlocale(LC_MONETARY, 'nl_NL');
        $current_merchant_id = $post->merchant_id;
        $stars = floatval(get_post_meta($post_id_by_merchant[$current_merchant_id], 'reviewsterren', true));
        $review_amount = get_post_meta($post_id_by_merchant[$current_merchant_id], 'aantal_reviews', true);
    ?>
    							    <div class = "row">
    								<div class = "item logo"><?php echo get_the_post_thumbnail($post_id_by_merchant[$current_merchant_id]); ?></div>
    								<div class = "name"><?php echo get_post_meta($post_id_by_merchant[$current_merchant_id], 'name', true) ?></div>
    								<div class = "review-container"><div class="stars" style="--rating: <?php echo $stars ?>;" aria-label="Rating of this product is <?php echo $stars ?> out of 5."></div><div class = "reviews"><?php echo $review_amount . " reviews" ?></div></div>
    								<div class = "item price-actual"><?php echo money_format("€%.2n", $post->price_actual); ?></div>
    								<div class = "item price-total"><?php echo money_format("€%.2n", $post->total_price); ?></div>
    								<div class = "item view"><button class = "button"><a href="<?php echo $post->link; ?>" target="blank">Bekijken</a></button>
    							    </div>
    							</div>
    							
    						<?php
    endwhile; else : ?>
    	<p><?php esc_html_e( 'Geen producten gevonden.' ); ?></p>
    <?php endif; ?>
    						</div>
    <?php
    //wp_reset_postdata();
    //wp_reset_query();
    ?>
    
    				</div>
    			</div>
    		</main>
    	</section>
    </div>
    

    Thanks in advance.

    #229944

    Anonymous
    Inactive

    Hi,

    I have these taxonomies:
    – Product
    – Merchant
    – Merchant offer

    I created a custom post template to make it possible to view all merchant offers for a product, with the possibility to filter on both merchant meta fields (review, payment methods..) as on merchant offer meta fields (price, delivery time..)
    Now I see that the S&F Pro plugin shows filter options for every existing post instead of the current viewed product. When you see my code below (this is my very first php-code, so when it is looking strange, that’s why), do you have a hint how to show only filter options for the current viewed product?

    <?php
    /*
     * Template Name: Product
     * Template Post Type: post, page, product, item
    */
    
    get_header(); ?>
    
    <?php
    $link = get_post_custom_values("link") [0];
    
    $color = get_post_custom_values("kleur") [0];
    //echo get_post_custom_values("product_group")[0];
    
    ?>
    
    <div id="content" class="site-content">
    	<section id="primary" class="content-area">
    		<main id="main" class="site-main">
    			<article id="post-2" class="post-2 page type-page status-publish hentry entry">
    			<div class = "pdp-full-top">
    			    <div class = "pdp-top-container entry-header">
    				<h1 class = "pdp-title">
    					<?php
    $brand = get_post_custom_values("brand") [0];
    $line = get_post_custom_values("line") [0];
    $type = get_post_custom_values("type") [0];
    $variant = get_post_custom_values("variant_value") [0];
    echo $brand . " " . $line . " " . $type . " " . $variant;
    ?>
    				</h1>
    				<div class = "pdp-image-container"><div class = "pdp-image-helper"></div><?php the_post_thumbnail(); ?>
    				</div>
    				<div class = "pdp-top-info-container">
    					<h2 class = "pdp-sub-title">
    						<?php
    $product_group = get_terms(array(
        'taxonomy' => 'productgroep',
        'hide_empty' => false,
    )) [0]->name;
    echo $product_group . ", " . $variant;
    ?>
    					</h2>
    					<h5 class = "pdp-choise-criteria">Keuzecriteria</h5>
    					<div class = "pdp-price">Prijs vanaf ...
    					</div>
    				</div>
    			    </div>
    			</div>
    			<div class = "pdp-lister-container entry-content">
    			<?php //Filter area ?>
    				<div class = "pdp-filter-container">
    					<?php echo do_shortcode('[searchandfilter id="165176"]'); ?>
    					<?php echo do_shortcode('[searchandfilter id="153395"]'); ?>
    				</div>
    				<div class = "pdp-shopping-list-container">
    					<?php
    //Get all merchants
    $ean = get_field("ean");
    $args_merchants = array(
        'post_type' => 'merchant_offer',
        'tax_query' => array(
            array(
                'taxonomy' => 'ean',
                'field' => 'slug',
                'terms' => $ean,
                'compare' => '='
            ) ,
        )
    );
    $offers = new WP_Query($args_merchants);
    $all_merchants = [];
    while ($offers->have_posts()):
        $offers->the_post();
        $get_merchant = get_post_meta(get_the_ID() , 'merchant_id') [0];
        array_push($all_merchants, $get_merchant);
    endwhile;
    //Get filtered merchants
    wp_reset_postdata();
    wp_reset_query();
    $args_offers = array(
        'post_type' => 'merchants',
        'search_filter_id' => 153395,
        'tax_query' => array(
            'relation' => 'OR',
            array(
                'taxonomy' => 'merchant_id',
                'field' => 'slug',
                'terms' => $all_merchants,
                'operator' => 'IN',
            ) ,
        )
    );
    $query2 = new WP_Query($args_offers);
    
    $filtered_merchants = [];
    $post_id_by_merchant = [];
    
    while ($query2->have_posts()):
        $query2->the_post();
        $get_filtered_merchant = get_post_meta(get_the_ID() , 'merchant_id') [0];
        array_push($filtered_merchants, $get_filtered_merchant);
        $post_id_by_merchant[$get_filtered_merchant] = get_the_ID();
    endwhile;
    //Get filtered offers by filtered merchants
    wp_reset_postdata();
    wp_reset_query();
    $args_filtered_offers = array(
        'post_type' => 'merchant_offer', //add filter id somewhere here!
        'search_filter_id' => 165176,
        'tax_query' => array(
            'relation' => 'AND',
            array(
                'taxonomy' => 'ean',
                'field' => 'slug',
                'terms' => $ean,
            ) ,
            array(
                'taxonomy' => 'merchant_id',
                'field' => 'slug',
                'terms' => $filtered_merchants,
            ) ,
        ) ,
    );
    
    $query3 = new WP_Query($args_filtered_offers);
    //Build shopping list
     ?>
    						<div class = "pdp-shopping-list">
    							<div class = "row header">
    								<div class = "item"></div>
    								<div class = "item">Winkel</div>
    								<div class = "item">Reviews</div>
    								<div class = "item">Basisprijs</div>
    								<div class = "item">Totaalprijs</div>
    								<div class = "item"></div>
    							</div>
    						<?php while ($query3->have_posts()):
        $query3->the_post();
        setlocale(LC_MONETARY, 'nl_NL');
        $current_merchant_id = $post->merchant_id;
        $stars = floatval(get_post_meta($post_id_by_merchant[$current_merchant_id], 'reviewsterren', true));
        $review_amount = get_post_meta($post_id_by_merchant[$current_merchant_id], 'aantal_reviews', true);
    ?>
    							    <div class = "row">
    								<div class = "item logo"><?php echo get_the_post_thumbnail($post_id_by_merchant[$current_merchant_id]); ?></div>
    								<div class = "name"><?php echo get_post_meta($post_id_by_merchant[$current_merchant_id], 'name', true) ?></div>
    								<div class = "review-container"><div class="stars" style="--rating: <?php echo $stars ?>;" aria-label="Rating of this product is <?php echo $stars ?> out of 5."></div><div class = "reviews"><?php echo $review_amount . " reviews" ?></div></div>
    								<div class = "item price-actual"><?php echo money_format("€%.2n", $post->price_actual); ?></div>
    								<div class = "item price-total"><?php echo money_format("€%.2n", $post->total_price); ?></div>
    								<div class = "item view"><button class = "button"><a href="<?php echo $post->link; ?>" target="blank">Bekijken</a></button>
    							    </div>
    							</div>
    							
    						<?php
    endwhile; ?>
    						</div>
    <?php
    wp_reset_postdata();
    wp_reset_query();
    ?>
    
    				</div>
    			</div>
    		</main>
    	</section>
    </div>
    

    Thanks again in advance.
    Best regards,
    Roeland van Oostenbrugge

    #227478

    Anonymous
    Inactive

    i create search form, i use shortcode, i create page with my shortcode but the results not good,
    i use like this:

    function select_artist_in_filter_page() {
    	$args = array('post_type' => 'artist','posts_per_page' => -1);
        $my_query = new WP_query($args);
       if($my_query->have_posts()) {
    		echo '<div class="elementor-container elementor-column-gap-default">
    		<div class="elementor-row">
    				<div class="elementor-element elementor-element-80b276a elementor-column elementor-col-100 elementor-top-column" data-element_type="column">
    			<div class="elementor-column-wrap  elementor-element-populated">
    					<div class="elementor-widget-wrap">
    				<div class="elementor-element elementor-element-62b3681 elementor-grid-4 elementor-grid-tablet-4 elementor-grid-mobile-1 elementor-posts--thumbnail-top elementor-card-shadow-yes elementor-posts__hover-gradient elementor-widget elementor-widget-archive-posts" data-element_type="widget" data-widget_type="archive-posts.archive_cards">
    				<div class="elementor-widget-container">
    					<div class="elementor-posts-container elementor-posts elementor-grid elementor-posts--skin-cards elementor-has-item-ratio">';
            while($my_query->have_posts()) { 
    			$my_query->the_post();
                $custom = get_post_custom(get_the_ID());
    			$image = wp_get_attachment_image_src( get_post_thumbnail_id( $args->ID ), 'single-post-thumbnail' ); // the images for the artist	
    			echo '<article class="elementor-post elementor-grid-item post-170 artist type-artist status-publish has-post-thumbnail">
    			<div class="elementor-post__card">
    			<a class="elementor-post__thumbnail__link" href="'.get_permalink($args->ID).'">
    			<div class="elementor-post__thumbnail"><img height="150" src="'.$image[0].'" alt=""></div>
    		</a>
    				<div class="elementor-post__text">
    				<h3 class="elementor-post__title">
    			<a href="'.get_permalink($args->ID).'">'.get_field('artist_name').'</a>
    		</h3>
    				</div>
    				<div class="elementor-post_meta-data" style="text-align: center; background: #d80159;">
    				<a class="elementor-post__read-more" href="tel:'.get_field('Artist_Phone').'">'.get_field('Artist_Phone', $args->ID).'</a>
    				</div>
    				<div class="elementor-post__meta-data">
    					<span class="elementor-post-avatar">
    		המלצות: '.get_comments_number($my_query->ID).'	</span>
    				</div>
    					</div>
    						</article>';
    	   }
    		echo '</div></div></div></div></div></div></div></div>';
    	   wp_reset_postdata();
       }
    }
    
    function select_artist_in_filter_page_reset() { // reset the loop
    	ob_start();
    		select_artist_in_filter_page();
    	return ob_get_clean();
    }

    but i not see the real options, i see all artist i need to see the artist with location i choose in fitlers:
    https://mesibot.linuxisrael.co.il/filterresults/?_sft_location_artist=%d7%9b%d7%9c-%d7%94%d7%90%d7%a8%d7%a5
    this is the url

    way is not working ?

    #226945

    In reply to: Infinite Scroll


    Anonymous
    Inactive

    Hi Trevor,

    Apologies I’ve only just gotten around to trying this out, at the minute I get both messages coming up and I’m not entirely sure why, this is my results.php file.

    <?php
    /**
    * Search & Filter Pro
    *
    * Sample Results Template
    *
    * @package Search_Filter
    * @author Ross Morsali
    * @link https://searchandfilter.com
    * @copyright 2018 Search & Filter
    *
    * Note: these templates are not full page templates, rather
    * just an encaspulation of the your results loop which should
    * be inserted in to other pages by using a shortcode – think
    * of it as a template part
    *
    * This template is an absolute base example showing you what
    * you can do, for more customisation see the WordPress docs
    * and using template tags –
    *
    * http://codex.wordpress.org/Template_Tags
    *
    */

    if ( $query->have_posts() )
    {
    ?>
    <div class=”flex-grid” data-aos=”fade-up”>
    <?php
    while ($query->have_posts()){
    $query->the_post();
    ?>
    <div class=”RoleGridWrapper col”>
    <?php if( get_field(‘scrub_colour’) == ‘navy-blue’){ $postcolor = ‘#153F74’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘cornflower-blue’){ $postcolor = ‘#5184C4’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘mediterranean-blue’){ $postcolor = ‘#009EC7’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘ocean-blue’){ $postcolor = ‘#64BFD4’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘pale-sky-blue’){ $postcolor = ‘#97BADE’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘dark-green’){ $postcolor = ‘#00A296’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘mid-green’){ $postcolor = ‘#92CEBD’; } ?>
    <?php if( get_field(‘scrub_colour’) == ‘silver-grey’){ $postcolor = ‘#ABAAAB’; } ?>
    <div class=”roleContWrapper” style=”border-top: solid 10px <?php echo $postcolor; ?>”>
    <div class=”cardTAB”>
    <svg id=”scrubsIcon” data-name=”Layer 1″ xmlns=”http://www.w3.org/2000/svg&#8221; viewBox=”0 0 40 40″><title>Scrubs Icon</title><path style=”fill:<?php echo $postcolor; ?>;” d=”M39.6,7.22a40.13,40.13,0,0,0-13-4.12,1.11,1.11,0,0,0-1.39.72c-.43.91-.88,1.73-.92,1.8-1.72,3.28-3.54,6-4.18,6.19-.66-.16-2.48-2.63-4.25-5.63-.46-.76-.8-1.42-1.25-2.28a1.29,1.29,0,0,0-1.52-.77A37.94,37.94,0,0,0,.4,7.22a.78.78,0,0,0-.32,1L3.47,15a.79.79,0,0,0,.9.41l3.49-.87L6.78,36.11a.79.79,0,0,0,.79.83H32.43a.79.79,0,0,0,.79-.83L32.14,14.57l3.49.87a.79.79,0,0,0,.9-.41l3.39-6.78A.78.78,0,0,0,39.6,7.22Z”/></svg>
    </div>
    “>
    <h3 class=”postHeader”><?php the_title(); ?></h3>
    <div class=”postCATS”>
    <?php
    $categories = get_the_category();
    $parentCatName = get_cat_name($categories[0]->parent);
    if ( ! empty( $categories ) ) {
    ?>
    <span class=”parentCAT”><?php echo esc_html( $parentCatName ); ?></span>
    <?php
    }
    ?>
    </div>
    <p class=”postIntro”><?php the_field(‘brief_role_description’); ?></p>
    <div class=”readmoreWrapper”>
    <p class=”postreadmore” href=”<?php the_permalink(); ?>”>Learn more</p>
    </div>

    </div>
    </div>
    <?php
    }
    }else{
    //figure out which type of “no results” message to show
    $message = “noresults”;
    if(isset($query->query[‘paged’])) {
    if($query->query[‘paged’]>1){
    $message = “endofresults”;
    }
    }
    if($message==”noresults”) {
    ?>
    <div class=’search-filter-results-list’ data-search-filter-action=’infinite-scroll-end’>
    <span>No Results Found</span>
    </div>
    <?php
    } else {
    ?>
    <div class=’search-filter-results-list’ data-search-filter-action=’infinite-scroll-end’>
    <span>End of Results</span>
    </div>
    <?php
    }
    }
    ?>

    Can’t seem to see why it’s not choosing one or the other, the only way at the moment I can get it to find no results is to search for something that I know isn’t available.

    Thank you
    Scott

    #224682

    Anonymous
    Inactive
    
    $args = array('post_type' => 'post');
    $args['search_filter_id'] = 123;
    $query = new WP_Query($args);
    

    and

    
    <?php if ( $query->have_posts() ) : ?>
      <!– the loop –>
      <?php while ( $query->have_posts() ) : $query->the_post(); ?>
        <!– get post tags field –>
        <?php $checkbox_fields = get_field("checkbox_field_name"); ?>
    

    did my code markup wrong there whoops

    #224680

    Anonymous
    Inactive

    I got it working by using the following code from this page: https://searchandfilter.com/documentation/search-results/custom/

    `
    $args = array(‘post_type’ => ‘post’);
    $args[‘search_filter_id’] = 123;
    $query = new WP_Query($args);
    `

    and then using “the loop” and grabbing the checkbox field for each post:

    `
    <?php if ( $query->have_posts() ) : ?>
    <!– the loop –>
    <?php while ( $query->have_posts() ) : $query->the_post(); ?>
    <!– get post tags field –>
    <?php $checkbox_fields = get_field(“checkbox_field_name”); ?>
    `

    Then running a foreach on $checkbox_fields to display them or a certain amount of them for each result.

    Posting this here so people can use this in the future if they want to better control how their results are displayed.

    #223908

    Anonymous
    Inactive

    Sorry, Now is working but I have to reload the home page to see the results, if I don’t reload page the results are all posts.

    Any idea?

    My code:

    <?php echo do_shortcode ('[searchandfilter id="2611"]'); ?>
    		
    		<?php $args = array('post_type' => 'coche');
    		$args['search_filter_id'] = 2611;
    		$query = new WP_Query($args);?>
    
    		<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); // run the loop ?>
    			<div <?php post_class('col-sm-4 col-md-4'); ?>>
    			    <a class="thumb_rel" href="<?php echo get_permalink();?>"><?php echo get_the_post_thumbnail();?></a>
    			    <span class="posted-on">
    		            <span class="screen-reader-text">Publicado el </span>
    		            <time class="entry-date published"><?php echo get_the_date()?></time>
    		            <span class="tiempo_lectura">Tiempo de lectura <?php echo get_post_meta(get_the_ID(), 'tiempo_de_lectura', true)?>´</span>
    			    </span>
    			    <h4><a class="title_rel" href="<?php echo get_permalink();?>">
    				    <?php if( get_field('titulo_listado_3_noticias') ) { ?>
    				    	<?php the_field ('titulo_listado_3_noticias')?>
    					<?php } else { ?>
    					  <?php the_title (); ?>
    					<?php }?>
    				    </a>
    				</h4>
    			    <hr class="linea-post">
    			    <p><?php echo get_the_excerpt()?></p>
    			</div>
    		<?php endwhile; ?>
    		<?php endif; ?>
    		<?php wp_reset_query(); ?>
    #220782

    Trevor
    Participant

    Ah, OK.

    I think you should use our Shortcode method instead. See here and also follow the guide for customising:

    https://searchandfilter.com/documentation/search-results/using-a-shortcode/

    Then, either edit the results.php file yourself, or contact me and I will edit the results.php file for you. I think the content needs to be like this:

    if ( $query->have_posts() )
    {
    	?>
    	
    	<div class="ngo-list">	
    		<div class="table">
    				
                <table>
                    <tr>
    					<th>Name</th>
    					<th>Category </th>
    					<th>Website </th>
    					<th>Learn More </th>
    				</tr>
    	
    	<?php
    	while ($query->have_posts())
    	{
    		$query->the_post();
    		
    		?>
                    <tr>
    					<td><h5 class=""><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5></td>
    					<td><?php $term = get_field('ngo_category'); echo get_term($term)->name; ?></td>
    					<td><a href="<?php the_field('website'); ?>"><?php the_field('website'); ?></a></td>
    					<td><a href="<?php the_permalink(); ?>">View Details</a></td>
    				</tr>
    		<?php
    	}
    	echo paginate_links();
    	
    } ?>
                </table>
    					
            </div>
    	</div>	
    
    ?>
Viewing 10 results - 21 through 30 (of 90 total)