Update. The issue was that in-article Join statement was duplicating and not receiving “AS …” prefix. So had to manually add custom prefix to this new join (also in the Where query) and now working.
Hi. I was just about to do the same thing: allowing editors to search custom posts not only by titles, but also by a secondary title field.
However I am unable to make this work with the solution PeterSeb provided (also adding Join filter from the article). Looks like search for fields is completely ignored. Working if the query is run separately as a test, but not working here.
Yeah, this actually was a good idea.
That’s the code I used and even though it still searches, but the search itself is extremely quick.
if(!isset($args['s'])) {
$args['posts_per_page'] = 1;
$args['post_type'] = 'asdkjahdiuy';
}
return $args;
Hi. Have you solved this issue? This is what is happening to me too, cant figure out whats the issue.
Ok. So problem still exists in some browsers. Chrome on one PC works, on another no. Firefox on one PC works, on another – no. Still unable to find the solution.
Any devs on this?
Looks like problem disappeared same way as it appeared: with no apparent reason. Could have been a browser problem?
Problem for somewhat reason occurs only on Chrome browser. Also when editing the ACF fields in post, some of them are not being saved (the ones that are dropdown type). Am also unable to use repeated fields to add a field URL. Everything works fine on Firefox.
Any ideas?
Hi. I can second to that. Opening Media Library shows nothing, inside Post editing in ACF Image field images show up, but I am unable to add selected images to post.
In Media Library and in post editing I see these errors. Am using WP Media Folder plugin to manage my media library, but since the first error is ACF, I would presume it is connected to this plugin. Its newest PRO version. Have not tried to disable as it is not a live site.
Ok, so apparently the problem was that I created repeater fields with the same names as there were normal fields. And system did not like that at all. O tried my code with newly created repeater fields and it works.
Still waiting for help. Anyone?
Hi again. So I wrote this very basic code for myself to transfer my data from old custom fields to repeater fields:
foreach ($myposts as $mypost) {
$name = get_field('name', $mypost);
$date = get_field('date', $mypost);
if($name) {
$row = array(
'name' => $name,
'date' => $date,
);
$i = add_row('nameAndDate', $row, $mypost);
}
It transfers the data and it shows up in get_sub_field(). But not in admin panel (post edit) where I should be able to see that data in repeater field section. Whats the problem?
So basically I could just do a one-time loop over my posts to see if they have field “name” filled and if so, update sub_field (rather add_row) with the data? That way I would transfer my data to repeater.
Thank you! With some changes to search only in specific field and changing query to only search for posts, it works now as it should.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.