Search on a specific page for wordpress - php

Right now the search bar only searches for posts and such.
I have created a plugin and a subtheme/page for my site which displays data from this plugin. Basically it's persons and I want to be able to search for them both with name and description.
I have no idea where to start, can I change the current search bar's algorithm or do I have to change it completely?
I saw some plugins but I am unsure which one to choose, the easiest would be to make the entire site searchable but I guess that could make the results a bit too much as well I think.

Related

Adding custom attribute search in existing wordpress sidebar search in WordPress

Introduction
Hi all, I hope all devs are fine. For better understanding I am creating 3 sections.
I am new to wordpress development and Just have learned a little bit about plugin development and how they work.
User Requirements
Client Wants to add search products by users/vendors in an existing search form which is inside sidebar.php. it is ajax based search.
In our case user/vendors would be either individual or Pro.
how will it work
So when customer selects individual along with other existing attributes (size, color) it should show me products of all the individual users. If nothing is selected it should show all products from both users
What I have done so far
I copied the file (Sidebar) in my child theme and manipulated it to add two check boxes.
I saw the theme's database. BUT i don't know how to make check boxes work to get desired output.
PS
I am stuck on this problem for five days. Brain's not working anymore

Wordpress one pager: how to structure / posts or pages?

Heyho,
I'm new to wordpress and currently building a website for a client. It's a one-pager and I'm wondering how to build the backend.
Let's say it's a cat-business. And the structure is as following:
Haircutting
Baby Cat Haircutting
Long Hair Haircutting
Special Hair Cutting
Photoshooting
Single Studio Photos
Group Studio Photos
Owner + Cat Studio Photos
Outside Photos
Training
Faster Running
Higher Jumping
Better Mouse-Hunting
News
Contact
The categories 1—5 should form the Menu.
Every entry is (until now) a post and has several custom fields (e.g. Price, Duration, Location…) and that works fine. The Client needs to be able to edit / add / remove the single entries (e.g. "Special Hair Cutting").
How should I build it know?
First Idea
Making Pages for each category, showing the single posts assigned to the
"wordpress category"
Make the Home-Page show all the pages
Second Idea
Building everything in Posts
Building also the categories 1—5 in Posts and figure out how to apply
special CSS (workaround with Custom Fields?)
What is the smarter way to go?
Anyways I'd need further help afterwards, linking the best tutorials, as hours and hours of searching didn't help me any further.
Thanks.
Appologies for my bad English
You can build a simple one-pager by looping through the pages with depth 1 and then through each of their subpages. You can use the get_pages function for this.
Make sure to redirect the individual pages to an anchor on your one-pager/home (with a redirect plugin). This will prevent people from finding your individual pages through the search engine.
How get_pages works: http://codex.wordpress.org/Function_Reference/get_pages
How to loop through your (sub)pages: http://wordpress.stackexchange.com/questions/93844/child-pages-loop‌​

Implement Custom Search Plugin for Joomla

I would like to implement a Custom Search Plugin for Joomla 3.5.1. I am new to Joomla and still busy getting my feet together.
I recently implemented a plugin that adds custom/extra fields (5 fields, free text inputs) to an article in Joomla 3.5.1. I followed their tutorial on how to get this right and so far so good. This plugin saves the extra/custom fields in the #__user_profiles table as per their tutorial. I could obviously save it to a different table but since I am learning, I kept it simple. This plugin works perfectly and I can capture the extra fields and saves successfully and the data is saved along with the article id being edited/created.
My next task is to create another site/front-end "search" (or smart search) plugin. This plugin must group the 4 field's values and provide them to the user in the front-end as selects/dropdowns.
Is there someone that can give me a lead on how I can archive this. Must I implement it as a search or smart search plugin? Is it even possible to archive what I am trying to archive?
This search plugin will only appear on one page but that I know I can config correctly once I've a plugin. Once user searches, the system must post back the selected options and I will search the "#__user_profiles" for any matching profile_key vs profile_value and collect all user_id (article_id) and get these articles from contents table and return this list of articles to the front-end as search results. Anyone can help me into the right direction?
I tried their tutorial of creating a search plugin but I seem lost, mostly I don't know how to dynamically provide my selects/dropdowns with that info saved in the #__user_profiles table.
Please assist in anyway possible...
I don't think that this might be done without modifying core 'search' task. My advise is to advise search view and include extra filtering, then write own 'search' task which allow you to read this data and provide additional results.
By writing just search plugin you can only extend search results by data which is stored outside default Joomla! tables but nothing more.

Joomla 3.x, include menu items in search results

I've built several sites using Joomla and think it's a pretty decent framework to work with. However, one thing that really bugs me is that menu items don't show in the search results (com_search).
All I get is articles, contacts, weblinks, categories and news feeds which are all completely irrelevant to my needs. Right now, all I get in the results are links to articles (for example) which leads to that article but leaves out all the good stuff you get when accessing it through a menu item such as modules.
So what I really want to know is if it's possible to force the search component to include menu items and leave out stuff that is unnecessary?
EDIT
You know what, having reviewed my code and all that I've realised that my original question was a bit misleading. Now, what I REALLY want to accomplish is to restrict Joomlas com_search to ONLY search published menu items and nothing else. Is this possible?

Performing wordpress search from a plugin

What's the correct way of performing an article search from within a Wordpress plugin? I want to perform the search and get a list of matching posts and pages back. That is I want the list back in the plugin code for further processing. I keep thinking there should be a function I can call, but I can't find it.
I have not worked with this plugin and I'm not entirely sure whether it serves search results in the way you need, but I think it does. Take a look at Wordpress Search API plugin.

Categories