941-685-8851

‘Wordpress’

WordPress 3.0 Custom Post Types

WordPress 3.0 is a revolutionary release to the world’s #1 website content management system.  There are several new functionality additions to the WordPress 3.0 release, but custom post types is arguably one of the most important.

Custom post types empowers WordPress designers with a fantastic new toolset for creating custom WordPress websites.  In the following example, I’m going to make a very simple custom comment form to allow visitors to submit comments to a predefined post, creating a web page that can be used for submitting testimonials, etc.

This example assumes that you are familiar with editing WordPress template files, such as functions.php, single.php, ect. read more…

Share
 

WordPress web page order

When you create a new web page in WordPress, the order for the new web page defaults to ’0′, which positions the display of it’s navigation menu at the beginning of the stack. To change the web page order:

- Open the web page in the editor.

- On the right column there is a panel titled ‘Attributes’.

- This panel includes two menus: ‘Parent’ and ‘Order’.

- The ‘Parent’ menu allows you to make the web page a child of another web page.

- The ‘Order’ menu is where you specify the numeric web page order.

- Set this to whatever you want the respective web page’s order to be.

- For example if you have five parent web pages, set each web page’s ‘Order’ numerically from 1-5 respectively.

- When adding a new web page, set the new web page’s ‘Order’ to ’6′ if you want the web page navigation menu to display after all the other web pages, and so forth.

- Another example would be that you want a new web page to display fourth in the middle of the current web pages. To accomplish this, set the new web page’s numeric order to 4, then open the web pages that were previously set as 4 and 5, and change them to 5 and 6 respectively.

Share
 

Disable RSS Feed

To disable the rss feed and redirect to the home page in wpmu:

Add this code to functions.php

/**
 * Disable Our Feed Urls
 */
function disable_our_feeds() {
 wp_redirect(get_option('siteurl'));
}

add_action('do_feed', 'disable_our_feeds', 1);
add_action('do_feed_rdf', 'disable_our_feeds', 1);
add_action('do_feed_rss', 'disable_our_feeds', 1);
add_action('do_feed_rss2', 'disable_our_feeds', 1);
add_action('do_feed_atom', 'disable_our_feeds', 1);

and/or
open wp-feed.php, wp-rss.php, and wp-rss2.php and change the following line:

wp_redirect( get_bloginfo( 'rss2_url' ), 301 );

to

wp_redirect(get_option('siteurl'));

Another method is to create a folder in the WordPress root directory called ‘feed’ and post a custom index.php page.  When accessing  feed this page will be displayed instead of a feed.

Share
 

WordPress Blogroll import – export

The ability to import existing blogroll links from one Wordrpess website  into another could be a big timesaver. Manually recreating Blogroll links in Wordrpess can be a tiresome task, especially if you have many links. Fortunately, WordPress has an easy way to automate this task.

First, export the links:

OPML (Outline Processor Markup Language) is an XML format for outlines. In wordpress, OPML is already created for you. You can access it using the below mentioned URL:

http://yourdomain.com/wp-links-opml.php

You can save this file for storage

Second, export the links:

Import the existing blogroll from the OPML URL or the file you saved to your local system.

1)     Login to your WordPress dashboard.

2)     Click on Tools>Import.

3)     Select Blogroll.

4)     Enter the OPML URL of your blog or select the file from your local system.

5)     Click on Import.

The Blogroll links have now imported to the new Wordrpess website

Share
 

WordPress functions.php

Here is the default WordPress functions.php:

--------------------
<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */

$content_width = 450;

automatic_feed_links();

if ( function_exists('register_sidebar') ) {
 register_sidebar(array(
 'before_widget' => '<li id="%1$s">',
 'after_widget' => '</li>',
 'before_title' => '<h2>',
 'after_title' => '</h2>',
 ));
}

 ?>
----------------

Here is a customized functions.php:

----------------

<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */

$content_width = 650;

automatic_feed_links();

if ( function_exists('register_sidebar') ) {
 register_sidebar(array('name'=>right.'Right',
 'description'=>right.' The Right SideBar',
 'before_widget' => '<li id="%1$s">',
 'after_widget' => '</li>',
 'before_title' => '<h2>',
 'after_title' => '</h2>',
 ));
if ( function_exists('register_sidebar') ) {
 register_sidebar(array('name'=>left.'Left',
 'description'=>left.' The Left SideBar',
 'before_widget' => '<li id="%1$s">',
 'after_widget' => '</li>',
 'before_title' => '<h2>',
 'after_title' => '</h2>',
 ));
}

 ?>
------------------------
Share