use advance custom field inside query post command [closed]

When you do this: <?php query_posts(‘category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5′); ?> The string argument is literally category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5. Well, it would be if the string were not also triggering a fatal error. What you have is (assuming I haven’t lost track of the mess): String 1: ‘category_name=<?php the_field(‘cat_1_name’); ?>’,’showposts=5′ An undefined constant: cat_1_name An out of … Read more

ACF loop and php formatting

If it can be explicetly defined as the_title, then this should work for you: $pages = get_pages(array (‘sort_column’ => ‘menu_order’)); foreach ($pages as $page_data) { $fields = get_fields($page_data); if( $fields ) { echo ‘<div class=”the_title”>’ .$fields[‘the_title’] . ‘</div>’; echo ‘<div class=”container”>’; foreach( $fields as $field_name => $value ) { $field = get_field_object($field_name, false, array(‘load_value’ => … Read more

How to filter post using custom feild value in shortest and longest duration?

I have used the following code for implementing filters on the front end; //placed this code in index.php after <?php get_header(); ?> <?php $search = isset( $_GET[‘s’] ) ? $_GET[‘s’]: null; if( $search ){ $user_filtre .= ‘s=” . $_GET[“s’] . ‘&’; } $filtre = isset( $_GET[‘filtre’] ) ? $_GET[‘filtre’]: ‘date’; $cat = isset( $_GET[‘cat’] ) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)