WordPress Plugin Development Idea? Is this possible? Am I on the right track? - wordpress

I'm very new to WP development. I host a website which needs a list of trails (hiking, biking, etc) and I'd like to write a WordPress plugin to do it.
Can someone please tell me if I'm taking the right approach, and if what I'm proposing is possible.
I'd like the site to end up with an auto-generated and filtered index at http://example.com/trail-guide, and the discrete trail info pages at http://example.com/trail-guide/trailname. This data would all be stored in a single database table holding info for each trail, with an admin page for adding, editing, and deleting entries from here.
Is a WP plugin the best way to go about doing this, or should I be looking at something else?

From the way you're describing, your best bet would be to Register A Custom Post Type. This can be done by adding to your existing theme's Functions.php file, or by creating a plugin.
If you don't plan on changing themes, my advice would be to just hardcode everything into your functions.php file. Otherwise, creating a plugin for this particular job would be the safest alternative.
Using this functionality in tandem with Custom Meta Boxes and Custom Taxonomies will allow you to keep everything organized within the Wordpress Framework with your own special data.
This means that these new posts can also be queried at any time through the standard Wordpress Loop or search box.
If you are uncomfortable with writing your own functions to extend your existing framework, you might want to look into some plugins like GD Custom Posts And Taxonomies Tools to manage your own.
Hope this helps.

Related

Wordpress: How to create frontend table using data from backend DB table

I am relatively new to WP, and am trying to figure out if the following can be done, or if a plugin exists?
I am looking to save data (500K+ rows) into a SQL table (maybe a new table in WP database), and then render the results on a page (frontend) using some basic JS and CSS. Because of the size of data, I am not sure if I should use a plugin that imports from CSV/JSON and would it slow down the site.
Do I have to go all the way and create models and views and then render to an HTML, or is there an easy hack available?
As the last resort, I am also thinking of creating the table part using Flask and SQlite and use it as main domain, and WP blog as subdomain (don't know if it will impact SEO).
Request guidance from experts. TIA
There are plugins to handle table work. Use your favorite internet search engine to find them. You'll have to experiment with various plugins to get one that meets your needs if you go that route.
There two questions here.
One is how to render a table on the front end. If you do this yourself , your best bet is to create a plugin that defines a shortcode. When you write php code for that shortcode's handler, you will include code to read and render the table. You'll probably render it as an ordinary html <table>.
Then, you'll use WordPress's content editor to create a post, or a page, that contains your shortcode. When a visitor views the post or page, your shortcode handler runs and delivers the table you want.
The WordPress plugin API also gives you a way to enqueue css and Javascript to your pages. And, jquery is an inherent part of WordPress's page loads. WordPress also contains most of jqueryUI. That's handy, because there's a really nice jquery-based plugin called Datatables that will get your users some convenient features like pagination and sorting.
The second question is how to load that data into a table. The easy way would be to do it outside WordPress, with a SQL file or some other program to bulk-load it. But if you do it inside WordPress, you'll do it from an administrative page.
If you need to be able to add, update, or delete table entries from the front end, that's going to be some work.
Explaining all this in detail is far outside the scope of a Stack Overflow answer.

Add dynamic content to a WordPress Page

I want to know the most elegant/best practice way to do the following:
Let's say I have some PHP that returns a string (today's weather, for example). I want to be able to include the string within a WordPress Page, but not by using a plug-in to allow PHP within a Page.
So for example:
This is content of the page that is editable via WordPress pages.
Today's weather is THE_WEATHER. This bit is also editable, but as
an editor I can't edit the PHP that just told us what the weather
is, the developer does that.
What is the best practice way to do this (preferably without using plug-ins)?
Offhand, it sounds like you want to define a shortcode that lets you invoke the PHP function you're talking about and insert its result into a page/post. This pretty much means that you're writing either a (very simple) plugin or you're incorporating the shortcode definition into the functions.php file associated with a theme (which can be a simple child theme of the one you're using).
Which to do probably depends on whether or not you're likely to change themes (if it's just one site) or whether or not you need to do the same thing on different sites that can have different themes. If either is the case, then you should write it as a plugin; otherwise you can just make it part of your theme.
Consult the Codex to learn how to define shortcodes.

Wordpress Functionality: Custom Theme or Plugin?

I am new to Wordpress (using roughly 6 months) and just now getting into development when I decided I would attempt to replicate a project I have going currently and after reading multiple blogs regarding plugin development and custom post types, I am thoroughly confused as to which direction I should go. I am in need of creating a site that has back-end management (admin only) and then end-user management where the end-user should have a page that allows them to manage their items.
With custom post types, I am able to create the objects that I will need to use but that doesn't give me total control when it comes to allowing the end-user to modify them from a front-end interface.
With a plugin, I think I am able to create exactly what I need but not sure how to yet but at the same time, thinking through the structure of Wordpress, everything is basically a post, correct? So, if that's the case, my plugin would need to have the ability to register new custom post types. Does it sound like I am on the right track or am I way off here?
Custom Post Types can add a lot of power, especially if you dress up the Custom Fields with meta boxes. You can always use a role-scoping plugin to limit the access of end-users to only be able to use these Custom Posts and nothing else. CPT are a great way to handle inventory management and not rely on a plugin that will either cost $ or potentially break months down the road.
That said, many plugin you would find would most likely just create a Custom Post Type anyway. Take a look around on the codex for info on creating CPT, and if you're interested, look at jaredatch's work on Github.
http://codex.wordpress.org/Post_Types
https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress

How to add one more editor for pages /post in wordpress

Hello Friends I want to add one more editor for wordpress pages/post .Is there is any plugin or any thing .Please let me know if any one having any idea about this.I shall be very thank ful to you
Do you mean you want to use a different editor for posts/pages than the built in one? I haven't tried this one but it looks good and I've been meaning to try it:
http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/
If you are looking for multiple VISUAL/HTML editors (to control different parts of your post/page), you can either use custom fields or a plugin called PODS CMS.
If you are using custom fields, read:
codex.wordpress.org/Custom_Fields
A very popular plugin that works with custom fields is FLUTTER. I haven't used it myself, but I have used other plugins and I would probably go with Flutter because of what I have heard about it.
If you use PODS CMS, be aware that it doesn't work with plugins that require custom fields (for example, many feature slider plugins) but it's a great way to have multiple text fields on the same page. It's great for very customized content.
PODS CMS does require some php knowledge but the documentation online is very good:
mondaybynoon.com/2010/01/04/introduction-to-pods-cms-wordpress/
Personally, if I have more than one custom field per post/page, I would go with PODS, but that is just my preference.
I got the solution of above question.
http://wordpress.org/extend/plugins/multiple-content-blocks/
Using this you can easily add one more editor for page or posts
Thanks

WP: writing an admin plugin for managing custom content

A client of mine has a site in wordpress, with one section being a directory of agents that each have different text and videos associated with them.
The client wants to be able to easily add/remove/change these agents from within the wordpress admin interface. There will be anywhere from 50-75 of these agents, so doing each page manually is not very attractive.
We currently have 3 agents added as posts, and i understand that we can store additional information inside the post itself, so that is not a problem. What we would like to create is a simpler way of managing those pages where the content cannot be changed by the maintainer, and the additional fields on the post are hard coded so there would be no room for user error.
What i am interested in is if anyone has done something similar in the past and can share their approach and experience, or if anyone can point me in the right direction as to how i can accomplish this and what i need to be aware of.
Thanks.
Yes, Custom Post Types are a perfect fit for your needs. Here are some links to articles explaining them:
http://justintadlock.com/archives/2010/04/29/custom-post-types-in-wordpress
http://www.wpbeginner.com/wp-tutorials/how-to-use-custom-post-types/
http://thinkvitamin.com/dev/create-your-first-wordpress-custom-post-type/
You can use a plugin like Custom Post Type UI or just add the register_post_type() calls to your theme's functions.php file:
http://wordpress.org/extend/plugins/custom-post-type-ui/
Then you can use a plugin like "Simple Fields" to add metaboxes to your Agent post type (although there are numerous plugins offering similar functionality; I'm building one myself!):
http://eskapism.se/code-playground/simple-fields/
Hope this helps...
Have you thought about using custom post types? You could create type called Agent and then each agent would be like a post. That way you could search for specific agents easily in the admin and then go in to the post for each agent to change their details.

Resources