I have posts with documents as attachment which we saved it as post meta.
Whenever user search with any keyword on site it should look into the document as well for that keyword. If keyword found then we will show the post in search results.
The SearchWP indexing the document but content Field on edit screen is empty.
Please let me know if anyone knows it.
Thanks in advance
The easiest way to do this is to try using the Elasticpress plugin.
From the homepage:
Documents: Indexes text inside of popular file types, and adds those files types to search results.
Related
I am new to wordpress, I have searched this thing on net but unable to find exact solution.
I have created a post that contains the Actor's Profile and the list of Movies Actor has worked in. Each Movie has also a different Wordpress Post that contains Movie details.
Now i want to create a link on each Movie, by which user can view the details of that particular movie.
This following link gives the result
<a href="http://localhost/wordpress/2015/10/09/movie-main-page">
but if i add this in each post, then it would be very difficult for me in future, when i will be uploading the site on web server, to change each link individually on every post.
I believe that there must be some way out there better than what i doing here, but somehow i am unable to find that trick.
Kindly guide me.
Thanks
You can use the get_site_url() template tag to return the site url and concatenate into the string. I haven't tested this code, so it might need some tinkering, but it should get you started:
<?php echo '<a href="' . get_site_url() . '/2015/10/09/movie-main-page">' ?>
wordpress link to anchor on another page
If Your Movie Page URL is Same Then You can use
echo get_permalink('11');
Here 11 is id of the page/post.
or if you have different different post for movies that can have different urls.
You can use wp_query loop for each post
[https://codex.wordpress.org/Class_Reference/WP_Query][1]
and use simply **echo get_permalink();**
There are two ways to achieve what you're doing.
The first and easiest way would be to run a search and replace on the database to change any URL's in your posts to the new URL. You should have a look at https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ .
You could also use Advanced Custom Fields to Achieve this. You would need to use the post object field to link to another page within wordpress. With the post object field you can create a field for each post that links to another post which you can then display in your template. Take a look here https://www.advancedcustomfields.com/resources/post-object/. With this method you could transfer all the content and associated links would still work.
I have a cloud search domain which is integrated and working well to generate fields.
I have three facets which are
Class
Title
Content
all the above are text fields
Now i have a need to add suggestions and get search term suggestions on the site. for this i've got two requirements
To give suggestions from the Title as the source
To provide suggestions from the Title but also only with the entries which has Class as Event
I am can easily do the first one,
how do i do the second ?
any help is highly appreciated
There was no solution for this one,
what i did was to have two indexes, and get the suggestions from one. the indexes were
Class
Title
EventTitle
Content
and for one fields i got the suggesters by Title and for the other one got them from EventTitle.
When running a search within WordPress it also seems to be picking up image links within the search leading to lots of unrelated articles being picked up. For example if the domain were example.com and you searched for "Example" it is finding any page that contains images or internal links in the HTML as the word example appears in the domain name being linked even though there is no other mention of the word "Example" within the content.
Is there any way to filter the search to ignore the HTML links? I can find many examples of plugins and code to remove pages or post types but nothing to ignore the raw HTML where it is purely functional.
Use Plugin- https://wordpress.org/plugins/search-exclude-html-tags/
2.If you have installed SEARCH EVERYTHING Plugin then change its settings because by Default it takes all HTML tags information during search operation.
I hacked ignite component to tag people to an image and send email to them, in the email body I need to insert a link to point to the article that contain this image.
I inserted the image in the article using ignite plugin.
how can I get the article link that contain ignite gallery plugin with categoryid = x
is it possible to get it ?
thanks alot
If you're using Joomla 1.5:
I'm not positive how this Ignite package works, but from looking at their website it seems that they're pushing galleries into articles on render? So from that I deduced, they're probably using something like onPrepareContent in their plugin which takes &$article by reference (so it can be modified). If you were looking to access the article ID in the plugin all you would have to do is use $article->id.
However, if you're looking to access the article ID in the component I would think you would just need to know the table that Ignite is storing the information in where it contains the article ID and the category ID. Then when you know the table you should just be able to query it and return article id where categoryid=x. If you haven't written a query before in Joomla this should help: How to use the database classes in your script.
If you have any more specific information please tell because it may help someone else who has used Ignite give you a better answer.
Since I had some comments on the formulation of my question, I decided to rewrite it completely. And also, I understand a little bit more about wordpress so it should make more sense now.
So, let's start with what I'm trying to accomplish by using a simple example:
Goal:
Make a search engine for some products and link to them using a database to generate the information.
Result:
http://my.site.url/wordpress/<plugin-name> <-- The page with the "search" and "search result
http://my.site.url/wordpress/<plugin-name>/products/<product_name> <-- When click on a search result
Part 1:
I want to make a plugin with the name "plugin-name" Right now, I put my code in
http://my.site.url/wordpress/wp-content/plugins/<plugin-name>
On the activate, I create some tables with some data. Since there is no page yet, I create 1 on the fly using the API call 'wp_insert_post'. I give the name and slug "myPlugin".
So, when I go on the main site, I can see my newly created page "myPlugin". But right now, there is no content attached to it. To do so, from what I understand, I need to create a page in my plug-in directory named "myPlugin.php".
http://my.site.url/wordpress/wp-content/plugins/<plugin-name>/myPlugin.php
So, how do I link the page I created manually and the source file in the plugin directory?
Part 2
When clicking on a link in the search result, I would like to have a page "product.php" and display its information. So, is it possible to create a "temporary url" for the result using sub pages (see result at the beginning)? And if possible, how can we achieve that?
Thanks in advance and I hope it's clearer.
u can find how to create plugin from
http://ditio.net/2007/08/09/how-to-create-wordpress-plugin-from-a-scratch/
in plugin write function for search(as per u r logic) fetch result
create a custom page refer video from www.wordpressmax.com/customize-wordpress/custom-page
in custom pages template in between get_header(); and get_footer(); call search function and display records.
Thats it.
thisMayhem is right. This sounds like a bunch of nonsense. But, if you're trying to make a WP page that executes some custom PHP, look up the WP template hierarchy.
What you can do is this:
create a WP "page" - call it "Search results."
create a template directory file called page-search-results.php (filename corresponds with slug of page from step 1)
put some generic header/footer stuff there (see other template files - most often it's just a question of putting in <?php get_header(); ?> and <?php get_footer(); ?>)
put PHP code in that thar page. in them hills.
if you use a caching plugin, may want to put an exemption for /search-results/
So, when someone pulls up http://your.site/search-results/ - your custom PHP code will execute. It's up to you to make that logic and communication happen - whether via $_GET or $_POST, etc.
I'm sorry you're experiencing some problems. Unfortunately as we say above because it's a 'one off' for a client project we can't support it - it works for them :) Feel free to rip it apart and retest and if you have any success let us know.