Add WordPress Dashboard Widgets

Finally WordPress 2.7 is coming along with widgets in the dashboard area, so it will be possible to adjust your dashboard as you like.

For Plugin or theme authors it's even more interesting, since they can give the users additional value to their Plugins. They can offer information from their Plugin directly on the dashboard. The user can decide if he likes to display them or not.

It's easy to integrate and can be controlled like Meta Boxes (explained in detail). The following example shows how you can integrate a widget in a dashboard.
Continue reading …

WordPress FTP Data With Constant

Since version 2.5 it's possible to update your Plugins automatically. It's necessary to input your FTP information before you update your Plugin.

It is very popular and an easy process, but I like to upload the newest version via my FTP client. How sure is the use of your FTP login information in your WordPress Admin? If you like to use another way, you can just put a definition of constants in your wp-config.php. Continue reading …

OpenSearch – Search Field For Mozilla And Internet Explorer With WordPress

Nowadays search field in your browser improved quite a bit, even IE supports OpenSearch format. But what is so great about OpenSearch and how easy it is to use with your WordPress installation has two aspects: WordPress comes already with OpenSearch and it's easy configurable with XML.

in IE 7

You just have to put a link in your theme and a xml file on your server to let the browser know that your blog supports the search field. So go ahead and improve your Plugin with little work and no use of a Plugin.

The following code should explain it. Adjust the syntax and link to the favicon and xml-file.

After you uploaded both files (favicon.ico und os.xml) add a link into the header.php of your theme. You can use the code one by one if you put os.xml in your root. After that it's possible to integrate your blog in Firefox and Internet Explorer.

The declaration of each XML tag is well documented on the OpenSearch website.

for the head area in your template - header.php:

<link rel="search" type="application/opensearchdescription+xml" title="<?php bloginfo('name'); ?>" href="<?php bloginfo('url'); ?>/os.xml" />

XML file:

Copy code, adjust and save as os.xml, then upload on your server.

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
	<ShortName>bueltge.de [by:ltge.de]</ShortName>
	<Description>Use bueltge.de to search on blog.</Description>
	<Url type="text/html" method="get" template="http://bueltge.de/?s={searchTerms}"></Url>
	<Contact>info@bueltge.de</Contact>
	<LongName>bueltge.de [by:ltge.de] Weblog Search</LongName>
	<Image height="16" width="16" type="image/x-icon">http://bueltge.de/favicon.ico</Image>
	<Tags>Weblog WordPress Webdevelopment</Tags>
	<Url type="application/atom+xml" template="http://bueltge.de/?q={searchTerms}&pw={startPage?}&format=atom"/>
	<Url type="application/rss+xml" template="http://bueltge.de/?q={searchTerms}&pw={startPage?}&format=rss"/>
	<Url type="text/html" template="http://bueltge.de/?q={searchTerms}&pw={startPage?}"/>
	<Query role="example" searchTerms="blog"/>
	<Developer>Frank Bueltge</Developer>
	<Attribution>
	    Search data Copyright 2007, bueltge.de [by:ltge.de], All Rights Reserved
	</Attribution>
	<SyndicationRight>open</SyndicationRight>
	<AdultContent>false</AdultContent>
	<Language>de-DE</Language>
	<OutputEncoding>UTF-8</OutputEncoding>
	<InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>

Sticky Function in WordPress 2.7

Flag for Sticky in WP 2.7

Flag for Sticky in WP 2.7


With WordPress 2.7 you are able to make a post sticky, so this particular post will be showed on the top always. Before that you had to use a Plugin.

You can activate this setting for a post in the publish area, where you edit the publish date. It's pretty easy to do.

But what, if you like to format the sticky post? For this matter there is a new function - post_class(). This gives classes for the different posts, also the class sticky, if it's a sticky post.

Additionally are classes for categories and tags available. An example here with some information.
Continue reading …

Secure Include Plugin In WordPress

Some people use more and other less Plugins in WordPress. but it is allways advisable to check via code if a Plugin is active or not. That makes sure the theme wouldn't break if the Plugin is not active. It's pretty easy to include a little bit code to check for inactivity. I show you an example where I use it in my Plugin RSSImport.

<?php if ( function_exists('FUNCTIONSNAME') ) : ?>
...
<?php endif; ?>

Example for Plugin RSSImport:
This is how the function looks like in the code of the Plugin RSSImport.

...
function RSSImport($display=0, $feedurl, $displaydescriptions=false, $truncatetitle=true) {

if ( $feedurl ) {
...
<?php if ( function_exists('RSSImport') ) : ?>
<?php RSSImport(10, "http://feeds.feedburner.com/WpEngineer", false, false); ?>
<?php endif; ?>

or a little bid smaller

<?php if ( function_exists('RSSImport') )
RSSImport(10, "http://feeds.feedburner.com/WpEngineer", false, false); ?>