nasho
Forum Replies Created
-
Well when I removed/unchecked a custom post type from the relevanssi indexes, the search didn’t return results from them, only from the ones that are checked (e.g. regular posts). so that means the relevannsi was active, right?
And while the index for the custom post type is still unchecked, i disabled the function, and the search returned results from the custom post type, and I guess that’s the wordpress search engine returning it. Edit: sorry, this is inaccurate, it also didn’t return results from the custom post type.So I put this code in my functions.php to force relevanssi usage. It seems to work based on my tests (by disabling a custom post type). However, it doesn’t seem to acquire the search settings i set in the admin page (like whole word setting, car returns posts with the word careful), while the admin search and my custom search (where i removed the relevanssi_do_query() function, thank you) follows it. They only return posts with the word car. Anything i can add in the code below to make sure it inherit my admin search settings?
add_action(‘pre_get_posts’, ‘enable_relevanssi_for_search’);
function enable_relevanssi_for_search($query) {
if (!is_admin() && $query->is_search() && $query->is_main_query()) {
$query->set(‘relevanssi’, true);
}
}Thank you, I found this in my themes’ function.php. I forgot I put it a couple of years ago and what it does. I guess that time, I didn’t want to search the post content but my requirement changed now. So I disabled this code and it works now.
add_filter( ‘relevanssi_index_content’, ‘return_false’ );
function return_false () {
return false;
}
By the way, since post content was searchable in my site’s main search bar even before disabling the code, does that mean that all this time, my main search bar is being served by wordpress’ default search engine and not by relevanssi?- This reply was modified 4 days, 3 hours ago by nasho.
That’s what I used, the ‘Admin search’ in the Dashboard.
I checked out a post with ‘vehicle’ in its content in the debugger, and the word vehicle did not appear:
The title2016 fare
Other taxonomies
adduci canada decarlos dortch drew gengen j jeremy katherine lee little pat r robert simmons sloan stewart thomas torrey triplett usa value
it seems it indexed my ‘actors’ for one, which is correct since i checked it. but how do i include the post content since I don’t see it in the settings.
Forum: Plugins
In reply to: [Ad Injection] Ads not showing, probably due to themeHi reviewmylife, I narrowed it somewhat to this line in your ad-injection.php:
if (!in_the_loop()) return $content; // Don't insert ads into meta description tagsThat line is found in
function adinj_content_hook($content). If I remove that line, then the ads are showing! 🙂 So I’m getting there.So this means the theme I’m using is doing something which makes your plugin think that it’s somewhere in the meta description tags section, or it has something to do with it.
You got any idea what I could change in the theme? I mean, I can remove that line from your plugin but it might have consequence like the ads will be inserted into meta description tags.
Forum: Plugins
In reply to: [Ad Injection] Ads not showing, probably due to themeHi reviewmylife, I think the Ad injection might not be recognizing the posts page as such, that’s why it treats it as a page to ignore? In the Tick to disable ads section, though, the posts are recognized by Ad Injection as it reflects the number of total posts (e.g. Single(4)). But when the posts are actually being viewed, no ad is showing as I think it is ignoring it. Any idea what variable I can change? I’m really new to WordPress 😛
Forum: Plugins
In reply to: [Ad Injection] Ads not showing, probably due to themeI replaced the line:
php require_once('single-review.php');with:
the_content(__('Read More »', 'gp_lang'));..directly and still, the ads did not display too. So I guess that wasn’t it.
Forum: Plugins
In reply to: [Ad Injection] Ads not showing, probably due to themeHi reviewmylife, thanks for the quick reply.
I’m a bit of a coder myself so I am investigating the files myself. If I understand it right, the ads should be triggered by the line below:
the_content(__('Read More »', 'gp_lang'));Is that right? If so, it seems that in the theme I’m using, single.php requires single-review.php (via require_once), then single-review.php calls review-tabs.php via require_once too, and it is in the file review-tabs.php where the line..
(the_content(__('Read More »', 'gp_lang'));)..is being called.
So with this setup I guess your hooks are not being triggered. Can you suggest anything I can do myself so that the ads will be triggered by the line from review-tabs.php?