Tag Info

Hot answers tagged

2

is_plugin_active() only available inside the admin area. You need to include the core plugin.php file in front end to use this function. From WordPress documentation NOTE: defined in wp-admin/includes/plugin.php, so this is only available from within the admin pages, and any references to this function must be hooked to admin_init or a later action. ...


2

Try using the count variable to increment the loop. <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"> <?php if(get_field('faq_general_ht')): ?> <?php $count=0; ?> <?php while(has_sub_field('faq_general_ht')): ?> <div class="panel panel-default"> ...


1

You need to loop for the results and call get_fields() again. So after your code add smt like: foreach( $locations as $l ) { //grab post id $pid = $l['ACF_Relationship_Field'][0]->ID; // grab fields $fields = get_fields($pid); // add them back. As ACF_Relationship_Field is an object I will add it next // to it, but you can do whatever ...


1

Anything to do with using the Google Places API is going to be off-topic here, but the best place to start would be the developer docs. However, how you interact with the API data within WordPress is certainly on-topic. I would suggest a wrapper function that caches the results periodically: /** * Get places data for a post. * * @param int|WP_Post ...


1

When I had developed a theme, and I was trying to automate the import process by tweaking wordpress-importer plugin. I had faced the same issue. When importing server processes numerous DB operations at same time, that's why it's not able to respond and it results in 500 Internal server error. Try 1 : To fix the issue, you have to import one by one. ...


1

Found a solution that works: add_filter('acf/fields/relationship/query/name=products', 'exclude_id', 10, 3); function exclude_id ( $args, $field, $post ) { $args['post__not_in'] = array( $post, 9, 10, 11 ); return $args; } Added in functions. This will exclude the pages with id 9, 10 and 11.


1

If you want to exclude ALL pages that doese't have 'collaborator' set as author, then you want to exclude all other pages in the site and include all pages of that author minus, maybe, some hand picked pages of that author, then I think you can use this: add_filter('acf/fields/relationship/query/name=products', 'exclude_id', 10, 3); function exclude_id ( ...


1

The users doesn't have permalinks nor titles. They have author links and display names. Changed the code: <?php while ( have_posts() ) : the_post(); ?> <h2>Resturants</h2> <?php $resturants = get_users(array( // Changed from get_posts ...


1

Sorted it out myself. The problem was, server was very slow to process the import. The process was happening behind the scene but server actually went down. When server was up, I could see all the content on the other site.


1

I've just solved this issue thanks to the Avanced Wordpress group in Facebook (https://www.facebook.com/groups/advancedwp/). It was actually a mistake I had made: I had a query before the custom fields and it had to be reset. This is the working snippet: <?php // WP_Query arguments $args = array ( 'post_type' => 'post', ...


1

Try to check class_exists: <?php if( class_exists('acf') ) { echo "hi"; } ?>



Only top voted, non community-wiki answers of a minimum length are eligible