How To Build A Media Site On WordPress (Part 1) - Smashing Magazine. Advertisement WordPress is amazing. With its growing popularity and continual development, it is becoming the tool of choice for many designers and developers. WordPress projects, though, are pushing well beyond the confines of mere “posts” and “pages”. How do you go about adding and organizing media and all its complexities? With the introduction of WordPress 3.1, several new features were added that make using WordPress to manage media even more practical and in this tutorial, we’re going to dive in and show you how.
In part one, we’re going to setup custom post types and custom taxonomies, without plugins. As we focus on building a media centric site, I also want you to see that the principles taught in this series offer you a set of tools and experience to build interfaces for and organize many different types of content. A “Media” center, of any type, added to an existing WordPress siteA repository of videos, third party hosted (e.g. Requirements Working Example We’re in good shape! Display posts from specific categories on a Page. WordPress Tips > Code Snippets > Display posts from specific categories on a Page You may want to display posts from a specific category on the homepage or other pages of your site.
For example, you might want to have a box that displays the latest three posts from your News category, or have links to your latest podcasts. In a previous post, I gave the code that would display the latest posts from a specific category in the sidebar. However, that code will not work in the main content part of the page. In order to display posts from a specific category in the main content section of a page, you need to use a variation on the WordPress Loop, which is as follows:<? Php query_posts('category_name=special_cat&showposts=10'); ? To use this code, change the category name to whatever the name is of the relevant category, and change the number of posts displayed from 10 to whatever number you want. Tags: categories Category: Code Snippets, WordPress as CMS.
Moderate new user registration in BuddyPress. Fix Wordpress Pagination Problems when used with query_posts. While working with WordPress, most of WP developers face problems with pagination especially when loop is customized with query_posts(). Query Posts is a powerful function provided by WordPress which offers numbers of options to control which posts are show up in Loop. I have gone through several sites where various fixes are available to fix Pagination issues, but only few of them worked when query_posts has been used. Moreover, most of them are related to modifying WP loop, which is not the proper way to fix this simple issue. Why do you need to modify a WP loop if you can customize post results using query_posts()? For more details how to use query_posts(), please refer to WordPress Codex on query_posts().
Coming back to Pagination Problem when used with query_posts() Many of the developers face problems with Pagination while using query_posts(). Why Pagination fails when used with query_posts: Here is the reason, why Pagination stops working with query_posts: <? Fix pagination on query_posts() Posts per Cat. Display Widgets. Category Displayer. Creating a Search Page.
Languages: English • 日本語 • (Add your language) A Search Page is a WordPress Page with a custom Page template to give users more information for searching your site. Things You Need to Know Different WordPress Themes feature different template files. Some include a search.php template file. To create your own custom Search Page, you will need to create a Page template to include your search form and the information you want your users to see before they search your site. Check your WordPress Theme to see if it includes a page.php template file. Using the page.php Using a text editor, open the page.php and save as searchpage.php (Note: The filename search.php is reserved as a special template name, so avoid its usage; the suggested searchpage.php just makes it easy to recognize in the list of files). At the top of your searchpage.php, before anything else, add this to give your Search Page a heading WordPress will recognize in the Administration Panels: For certain older versions of WordPress.
WordPress Debug Bar Plugin | BlackBox. Here is something that WordPress developers might find very useful. Recently when working with symfony i figured out it would awesome to have debug bar in WordPress, similar like symfony has since version 1.0. After Googling WordPress debug plugin it turned out there was no such solution so i decided to developed one myself. Here is why you will find it helpful: instantly inspect global variables (GET, POST, COOKIE, SERVER)debug both frontend and admin areaexecuted MySQL queries and time it took to execute each query (useful for finding slow queries)profiler for measuring performance of your plugins and themeserrors occurred when loading WordPress page If you will decide to use the plugin please remember it’s not a perfect solution, it uses some workarounds, but it’s gets the job done, is lightweight and unobstrusive which i think is most important.
Basically the debug bar is attached to the top of the browser window. Globals BTW. Profiler This is probably most useful feature of all. Errors. Ten Things Every WordPress Plugin Developer Should Know - Smashing Magazine. Advertisement Plugins are a major part of why WordPress powers millions of blogs and websites around the world. The ability to extend WordPress to meet just about any need is a powerful motivator for choosing WordPress over other alternatives.
Having written several plugins myself, I’ve come to learn many (but certainly not all) of the ins-and-outs of WordPress plugin development, and this article is a culmination of the things I think every WordPress plugin developer should know. Oh, and keep in mind everything you see here is compatible with WordPress 3.0+. Don’t Develop Without Debugging The first thing you should do when developing a WordPress plugin is to enable debugging, and I suggest leaving it on the entire time you’re writing plugin code. Enabling debugging also turns on WordPress notices, which is important because that’s how you’ll know if you’re using any deprecated functions. How to Enable Debugging define('WP_DEBUG', false); Replace that line with the following: if (! If (! Plugin API/Action Reference. Languages: English • Русский • 日本語 • Português do Brasil • (Add your language) This is a (hopefully) comprehensive list of action hooks available in WordPress version 2.1 and above.
For more information: To learn more about what filter and action hooks are, see Plugin API. To learn about writing plugins in general, see Writing a Plugin. (If you want to add to or clarify this documentation, please follow the style of the existing entries. Actions Run During a Typical Request These actions are called when a logged-in user opens the home page in Version 3.3.1. Actions are called with the function do_action(), except those marked (ref array), which are called with the function do_action_ref_array(). Actions Run During an Admin Page Request These actions are run when a logged-in user opens the Posts page in Version 3.3.1. In these actions, (hookname) depends on the page. Post, Page, Attachment, and Category Actions (Admin) post_submitbox_misc_actions add_attachment add_category category_edit_form. Administration Menus. Administration Menus Languages: English • 中文(简体) • 日本語 • Русский • (Add your language) Introduction Usually, plugin and theme authors need to provide access to a settings (options) screen so users can customize how the plugin or theme is used.
The best way to present the user with such a screen is to create an administration menu item that allows the user to access that settings screen from all the Administration Screens. Function Reference Every Plot Needs a Hook To add an administration menu, you must do three things: Create a function that contains the menu-building code Register the above function using the admin_menu action hook. It is that second step that is often overlooked by new developers. Here is a very simple example of the three steps just described. <? In this example, the function my_plugin_menu() adds a new item to the Settings administration menu via the add_options_page() function. These processes are described in more detail in the sections below. Dashboard Posts Media Links. Creating Options Pages ? WordPress Codex. Creating Options Pages Languages: English • 日本語 • Русский • (Add your language) This article is in transition to meet Settings API, which was introduced in Version 2.7.
For information prior to 2.7 see this revision. Introduction Creating custom options panels in WordPress is relatively easy. First, to create the menu item and the new page, see Adding Administration Menus. So long as you stick to this structure, WordPress will handle all of the option creation, update, saving, and redirection for you. Several new functions were added in WordPress 2.7. This article only covers the markup of the Settings page itself. Where to Save the Code You can either put the code for your options page in your plugin php file (or, for Themes, in functions.php), or you can create a second file called options.php, for example, and include it using the php include function - Opening the Page <div class="wrap"><h2>Your Plugin Page Title</h2> Form Tag Closing Tags <? Writing a Plugin ? WordPress Codex. Languages: English • العربية • বাংলা • Español • Italiano • a Plugin 日本語 한국어 • Português do Brasil • Русский • ไทย • 中文(简体) • (Add your language) WordPress Plugins allow you to easily modify, customize, and enhance a WordPress site.
Instead of changing the core program code of WordPress, you can add functionality with WordPress Plugins. Here is a basic definition. A WordPress Plugin is a program or a set of one or more functions written in the PHP scripting language, that adds a specific set of features or services to the WordPress site. You can seamlessly integrate a plugin with the site using access points and methods provided by the WordPress Plugin Application Program Interface (API). Wish that WordPress had some new or modified functionality? This article assumes you are already familiar with the basic functionality of WordPress and with PHP programming.
Resources To understand how WordPress Plugins work and how to install them on your WordPress blog, see Plugins. Plugin Name Home Page. Plugin API ? WordPress Codex. Plugin API Languages: বাংলা • English • Español • Français • 日本語 • 한국어 • Português do Brasil • ไทย • 中文(简体) • Русский • (Add your language) Introduction This page documents the API (Application Programming Interface) hooks available to WordPress plugin developers, and how to use them. This article assumes you have already read Writing a Plugin, which gives an overview (and many details) of how to develop a plugin. This article is specifically about the API of "Hooks", also known as "Filters" and "Actions", that WordPress uses to set your plugin in motion. These hooks may also be used in themes, as described here. Hooks, Actions and Filters Hooks are provided by WordPress to allow your plugin to 'hook into' the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion.
You can sometimes accomplish the same goal with either an action or a filter. Function Reference Actions Modify database data. Create an Action Function Hook to WordPress. Function Reference. Languages: English • Español • فارسی • Français • Italiano • 日本語 ქართული • 한국어 • Português do Brasil • Русский • Türkçe • עברית • 中文(简体) • 中文(繁體) • (Add your language) The files of WordPress define many useful PHP functions. Some of the functions, known as Template Tags, are defined especially for use in WordPress Themes. There are also some functions related to actions and filters (the Plugin API), which are therefore used primarily for developing Plugins. The rest are used to create the core WordPress functionality. Many of the core WordPress functions are useful to Plugin and Theme developers. So, this article lists most of the core functions, excluding Template Tags. You can help make this page more complete!
Here are some things you can do to help: Add documentation to un-documented functions, by creating sub-pages or at least by adding short comments in the lists below. Read Contributing to WordPress to find out more about how you can contribute to the effort! Functions by category. WordPress Custom Fields plugin « Steve Taylor. WordPress plugin: SLT Custom Fields « Steve Taylor. This plugin is aimed at plugin and theme developers who want a set of tools that allows them to easily and flexibly define custom fields for all post types, and for user profiles.
Full documentation at Code on GitHub. Issue tracking on GitHub. If you're not sure if you've found a genuine issue or not, please start a thread on the WP forum. Please note that this plugin isn't suitable for non-developers. If you think this plugin doesn't quite suit your needs, there is a comparison chart of similar plugins to find something that will! A Guide to WordPress Custom Taxonomy. In this guide, we will cover an incredibly great feature of WordPress: Custom taxonomy. Custom WordPress taxonomies give you unprecedented power in the way you can categorize and relate your WordPress content with each other. Though WordPress taxonomies were introduced in WordPress 2.3, it has been revamped in WordPress 3.0 for WordPress developers. Recently, we had looked at creating custom WordPress post types in the WordPress custom posts guide, and to further our command of WordPress 3.0 site and theme development, we’re going to now discuss custom taxonomies.
What is Taxonomy in WordPress? Taxonomy is simply a way of organizing data and, in the WordPress world, a taxonomy is a way of organizing and tying your site content together. Even though you don’t realize it, you’re probably already very familiar with at least one of the built-in WordPress taxonomies: WordPress tags. A custom taxonomy is exactly what it sounds like — a custom way to relate disparate content together. With: To: <? Adding a second custom taxonomy to a custom post type (both shown in its table)? The Loop in Action. The Loop in Action Languages: English • Español • 日本語 • 中文(简体) • Українська • Русский • (Add your language) Introduction "The Loop" is the main process of WordPress. You use The Loop in your template files to show posts to visitors. You could make templates without The Loop, but you could only display data from one post.
Before The Loop goes into action, WordPress verifies that all the files it needs are present. If the user didn't ask for a specific post, category, page, or date, WordPress uses the previously collected default values to determine which posts to prepare for the user. After all this is done, WordPress connects to the database, retrieves the specified information, and stores the results in a variable. By default, if the visitor did not select a specific post, page, category, or date, WordPress uses index.php to display everything. The World's Simplest Index Page The Default Loop Begin The Loop First, it checks whether any posts were discovered with the have_posts() function. <!
How To Create Wordpress Widgets - Lonewolf Designs. Taxonomies. Custom post types in WordPress. WordPress Custom Post Types Guide. Wordpress Plugin Tip – MySQL Transactions with $wpdb | Running A Website. Function Reference/register post type.