Custom WordPress Plugin - Create A FE Page - php

I am trying to create a custom plugin that adds a frontend page to the site. I have figured out how to have WordPress create the pages to the DB when the plugin is activated, but that gives the user the ability to delete them so I would like to create them sort of like adding a static page in the theme, but within a plugin.
I have found this article that shows how to use parameters to display a page, but I would rather have it be a specific slug, not a parameter: https://opensynergic.com/make-custom-plugin-front-end-page-in-wordpress/
Any assistance or direction would be amazing!
Thanks!

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.

How do I create a custom archive page that my client can edit?

Hi there Wordpress answers communnity
- I've created a custom post type.
I have set has_archive as true and understand I could also set it to has_archive => 'ctp'.
I also know that if I name a template file archive-cpt.php Wordpress will use this template for my cpt.
This is okay for some situations. But I'd like my client to be able to go to an editing page, like default posts and pages in the admin area.
I have thought about making the archive-cpt.php a template that can be called in a default page. Making that page the archive.
Am I on the right track? I'd really like to do this with the most up to date Wordpress method.
Thanks in advance for any guidance
custom-post-types customization templates archives
How do I create a custom archive page that my client can edit?
The Solution
I created a page called archive-mycustomposttype.php which wordpress automatically uses as the archive page for your custom post type, if it exists.
I then created a new section in wordpress's customizer and added controls with text, textarea and image settings.
I called the saved values via in the archive-customposttype.php template.
I hope this helps

How to update my Wordpress 3.0 widget admin page using the update function or equivalent?

I originally wrote my Wordpress 3.0 widget http://codex.wordpress.org/Widgets_API for editing on the widget page after it has been placed in a sidebar, which handles the updating automatically using the update() function in widget. It has grown and needs a widget admin page now so outside my widget class I added another action I found http://codex.wordpress.org/Adding_Administration_Menus to add a admin_menu, so far so good (hopefully I did it using a current API method but there didn't seem to another method in the widget.php file of WP). I created the form but I don't know how to update the widget now. I've looked through the code for widgets and I'm not sure how the update function actually works. I read that you can have options and add them to the database but if they already exist I don't want to abandon that data if there's a way to keep using it. The widget will keep two fields on the widget page and the rest will be handled on the admin page.
How do I update my widget from the admin page and have it be retrieved by the widget and can that be done in such a way that it is stored in the same place as my existing widget data using WP3.0 current widget API? If not how would I go about doing it?
The answer can be found in the "Plugin Options Starter Kit" plugin http://wordpress.org/extend/plugins/plugin-options-starter-kit/ that contains all you need to figure out how to use the settings API, adding admin menu pages and more. Can't wait to see the next update of this plugin.

Apply theme based on user selection in Wordpress?

I have an idea to create a template sites that basically shows a different templates in web page. When user select particular template, The site should have changed to that theme selected by user at run time. Is there any plugin to change the theme dynamically in wordpress. If not kindly help how can we implement this ?
This plugin called theme preview basically does what you want. Instead of actually switching the theme, it will preview it for the user, so only the actual user is affected of the theme change and not the whole environment!

WP Plugin Custom Search

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.

Categories