WP Plugin Custom Search - php

I want to make costume search plugin for Wordpress 3.0.5. Please look at here first HERE
as you can see at that website there is a dropdown with Country, AREA, TYPE. and when we click find. the URL will produce URL GET like this /?countryId=3&areaId=7&typeId=13
The question is. how i can make a search plugin with that $_GET, or can somebody give me link reference how to that?

I'm confused what you are trying to do, a plugin? Or functionality that handles the 'find' results?
If you just want the functionality, create a PAGE, call it 'find' and then set the 'TEMPLATE' of that page to a custom template. Create a custom page template by going via the wordpress codec
http://codex.wordpress.org/Pages
http://codex.wordpress.org/Pages#Page_Templates
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
Start by looking at the 'single.php' page, which is your standard wordpress template.
Once inside the template you use standard PHP to process the $_GET data and query your database.

Related

How to make a dynamic wordpress page (custom control/page template box)

I have completed numerous wordpress template tutorials focusing on implementing multiple pages, and a custom dynamic navigation. The only issue I have is finding a source on creating a custom template box. For example, my goal is to customize the page template box following the mock up. The content placement is done in php, and designed in css. That way I dont have to add content in php but instead add it in wordpress based on my custom design. I have not found any source to achieve this. Does anyone have a source that displays how to create custom template boxes(the dynamic part)?
Links below is what I used to create my wordpress site
https://www.smashingmagazine.com/2013/05/migrate-existing-website-to-wordpress/
custom navbar for wordpress using bootstrap
I tried another source called Dynamic Page Templates in WordPress, Part 2 which suppose to explain how to create custom controls/template boxes. Following the link was unclear, resulting in not achieving the goal.
Thanks,
There are many ways to create a dynamic page in WordPress. I am sharing one of it. Install Advanced Custom Field Plugin and read its documentation. It allows page content to be changed from back-end (Its great for text/images). For areas where you want to user to choose whatever custom widget she wants to choose, add a widget area following any custom widget tutorial.

Use Custom Post Archive Page for a specific Custom Post

I'm stuck on this issue with my Wordpress setup. My current setup is as follows: I have a custom post type "degrees" that are categorized by undergraduate, graduate, online, and abroad. The initial page is a specific taxonomy template I have set up for the user to specify which degrees to look through. Once a category is selected, the user will come to a landing page with all graduate programs, etc. This page is handled in the backend as a archive-degrees.php. Then, upon selecting a program, the template used is single-degrees.php. My problem is that I have one program (currently using the single-degress.php) that I would like to use the archive page as it needs to list out sub-programs. I hope that makes sense. Basically, I need this one specific Custom Post to use the archive page and then the single page for its sub-children. I am not sure if there is a way to do this. Any help will be much appreciated.
You're referring to specialized page templates. Your best bet is to create a new template for this page specifically.
From the Codex:
Create a template for one Page: For more extensive changes, intended for just one specific Page, you can create a specialized template file, named with that Page's slug or ID:
page-{slug}.php
page-{ID}.php
For example: Your About page has a slug of 'about' and an ID of 6. If your active Theme's folder has a file named page-about.php or page-6.php, then WordPress will automatically find and use that file to render the About page

Wordpress Styling

I am new to using Wordpress as a developer as opposed to just using the dashbord but am struggling to understand a few things and would really appreciate some help.
For a site that does not require a blog - do you just create custom/specific page templates for each page that your site requires?
If so - presumably you code the content directly. But then how does the client edit their website's about page or any other page for example - because doing it through the dashboard isn't going to use the necessary CSS hooks without using classes, id's and HTML?
As a beginner to Wordpress - I can't see that posts are used on sites that don't have a blog, but am I correct or is using posts the way a client can edit content on their site, but just have posts styled to look like normal content?
Or am I wrong in thinking a company (I am starting as an intern at a web dev company that use WordPress) provides the tools or at least configures WordPress to enable the client to change content?
Any help getting me to understand the basic concept and way a developer would create a custom WordPress site would be much appreciated. Thanks in advance.
You can use page.php. In WordPress everyone create at least one custom template type to get wider design for custom pages.
You can refer here for more info.
Use Advanced Custom Fields with page templates. Say you are making an About page, call that template about and select that template in the backend editor. Once you save the page, the acf fields will show up and you can populate the content.
ACF: https://www.advancedcustomfields.com/
Page Templates: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/

Wordpress plugin using existing theme

I am building a plugin for the first time and I have setup my rewrite rules to call a PHP file I have located in my plugin folder and this is working but all I have it output just now is "test"
I wanted to ask, is there is a way of pulling in the existing theme and using this as the basis for the page, then I can have my plugin just output the page content area so to speak.
My plugin is quite big in terms of the amount of data it handles so I would like to be able to use a menu link to the aforementioned file and this file can then output all the sub pages of content but still using the default theme (theme I have made) and fill the content area only is this possible and if so is there anything to explain this already available because I couldn't see it.
Any help with this would be much appreciated.
Edit: I have tried including a file from my current theme but this will give me a 500 error so I assume its not as simple as this.
Have you thought about using custom post types for your plugin content rather than relying on custom tables and separate code?
Other than that, you could use a shortcode (just one) and have users insert that into a regular WP page, the shortcode then displays all of your various plugin stuff.
It's hard to be more specific without understanding why you've done it this way.

Wordpress: getting latest post/image to display on an external (Posterous) site template

I have a site currently built on Wordpress. I have a requirement to pull out the "latest post" in a category (magazine issue), to allow the latest issue to be displayed in the sidebar of a Posterous blog template, either in an iframe or by other means.
What's the best way to achieve this? Shall I write a custom PHP page which queries the database directly to output the results that I want, and then display it in an iframe on the Posterous template? Or is there an easier way to achieve this?
You could register a widget to the sidebar or simply add code the sidebar.php directly. In the end, all you are doing is building a WP Query for the latest post in a category.

Categories