Wp Unique Article Header Image Plugin for WordPress

Jotted by brajesh on September 22, 2008

Update : 1st July 2010,

I am reviving this plugin again after an year. We will have a new release available by 3rd July 2010 for wp 3.0.

Hi all. Here I am back with another brand new plugin to enhance your blog. Ok, If you have ever thought of the following, then this plugin is for you.

  • You wanted to show unique header image on each single article page of your wordpress(or may be on some of the single article pages)
  • You wanted to have a unique background image for each of your single article page(or may be just on some of them)

If your answer is yes, Then this plugin is for you. It allows you to upload an image using the wordpress new post/edit post/page window. It adds a file uploading button just below the title of the post as shown below

New Post window
2

Now select an Image and when you click publish/save the default image is changed with the current image.

Browse Header Image to upload
2008-09-17_055340

Once you click save/publish, Go to manage->posts->your post and click to edit. You will see that the default image is changed with the new image uploaded.

Post edit window
edit-screen-gt-unique-header

How to use

For your use there is a method gt_get_image_url(), it returns unique image associated with each post. You may use it in any way you want. Here is an example, how I modified the default theme on the demo server to show unique header images on each post.

Now, let us edit our themes header.php to make use of unique header on each of the page.we add following snippet of code to our header .php

Code snippet to be modified

Code snippet to be modified

[Please note this code shown here, is for the default theme Kuberick, which comes with wordpress, depending upon your theme and header you may need to use custom css here]

See the live demo here [Click on the articles on the demo site to see the use of unique header thing)

NOTE:It seems , someone has deleted all the posts from the demo site, as I mistakenly provided the test user rights to edit/delete posts. Well, I will be correcting my mistake tomorrow. For the time being, I encourage you to login and try uploading some image of your choice on the demo site and looking at it in action.

http://plugins.wpdemos.com/gt-unique-header-image/

Do you want to try it yourself, well use following credentials

http://plugins.wpdemos.com/gt-unique-header-image/wp-admin/

User: test

Password: test

Try, posting some new posts with any image of your choice and then click to view the page.
ok, so you need a download link now. Here goes the download link
http://downloads.wordpress.org/plugin/wp-unique-article-header-image.zip

A new version of this plugin is ready. The new version supports PHP4/PHP5 and I have tested with wp 2.8.2. If you are interested in beta testing, please drop a line/leave a comment. I will appreciate your help.
Thanks
Brajesh

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]


get_user_by_email()

Jotted by brajesh on September 15, 2008

This is second in the series of un documented but useful wordpress api functions.

get_user_by_email($email)

Description

It is one of the important but not documented method on codex(as of now),It provides same information as the get_userdata(),get_userdatabylogin(), except the fact that it takes the email address of registered user(e.g. admin@geekytalks.com as an argument rather than the ID/username of user).It returns an object with the information pertaining to the user whose login name is passed to it. Properties map directly to wp_users table in the database.

Usage

The call to get_user_by_email() returns the user’s data, where it can be retrieved using member variables.

<?php
$user_info=get_user_by_email(get_option('admin_email));
echo ('Username:'.$user_info->user_login . '\n');
      echo('User level: ' . $user_info->user_level . '\n');
      echo('User ID: ' . $user_info->ID . '\n');
?>

Username: admin
User level: 10
User ID: 1

Accessing Usermeta Data

<?php
$user_info=get_user_by_email(get_option('admin_email));
echo ($user_info->last_name .  ", " . $user_info->first_name . "\n");
?>

Singh,Brajesh

Parameters

$email

(String) (required) The email address(of registered user) of the user whose data should be retrieved.

Default: None

Values in users & user_meta table

Here are the values in the users table you can access via this function:

users

  • ID
  • user_login
  • user_pass
  • user_nicename
  • user_email
  • user_url
  • user_registered
  • user_activation_key
  • user_status
  • display_name

useful in user_meta

  • first_name
  • last_name
  • nickname
  • user_level
  • admin_color (Theme of your admin page. Default is fresh.)
  • closedpostboxes_page
  • nickname
  • primary_blog
  • rich_editing
  • source_domain
  • It works in the same manner as get_userdata() ,except that the argument passed in get_userdata() is an integer(The ID of User),while In the case of get_userdatabylogin() ,the argument passed is string(The Login name e.g. “admin”)

See as a reference :http://codex.wordpress.org/Function_Reference/get_userdata

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]


get_userdatabylogin

Jotted by brajesh on September 13, 2008

I am going to describe here some of the methods which can come handy for a theme developer or plugin developer,but are not documented at WordPress Codex.Today, I am beginning the series with get_userdatabylogin($login_name)

Description

It is one of the important but not documented method on codex(as of now),It provides same information as the get_userdata() except the fact that it takes the login name(e.g. “admin” as an argument rather than the ID of user).It returns an object with the information pertaining to the user whose login name is passed to it. Properties map directly to wp_users table in the database.

Usage

The call to get_userdatabylogin() returns the user’s data, where it can be retrieved using member variables.

<?php $user_info=get_userdatabylogin("admin");
echo ('Username:',$user_info->user_login . '\n');
      echo('User level: ' . $user_info->user_level . '\n');
      echo('User ID: ' . $user_info->ID . '\n');
?>

Username: admin
User level: 10
User ID: 1

Accessing Usermeta Data

<?php $user_info=get_userdatabylogin("admin");
echo ($user_info->last_name .  ", " . $user_info->first_name . "\n");
?>

Singh,Brajesh

Parameters

$login_id

(String) (required) The Login_name(Login Id) of the user whose data should be retrieved.

Default: None

Values in users & user_meta table

Here are the values in the users table you can access via this function:

users

  • ID
  • user_login
  • user_pass
  • user_nicename
  • user_email
  • user_url
  • user_registered
  • user_activation_key
  • user_status
  • display_name

useful in user_meta

  • first_name
  • last_name
  • nickname
  • user_level
  • admin_color (Theme of your admin page. Default is fresh.)
  • closedpostboxes_page
  • nickname
  • primary_blog
  • rich_editing
  • source_domain
  • It works in the same manner as get_userdata() ,except that the argument passed in get_userdata() is an integer(The ID of User),while In the case of get_userdatabylogin() ,the argument passed is string(The Login name e.g. “admin”)

See as a reference :http://codex.wordpress.org/Function_Reference/get_userdata

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]


Test your web design in different browsers online

Jotted by brajesh on August 30, 2008

As a web developer the life is not that much easy.The daily quirks of various browsers makes the life too difficult.Above all ,we need to maintain the web standards and compatibility in the browsers at the same time.

Another Issue ,after all,how many browsers I should keep on my system.For me,I like to keep at least the following-IE,Fire Fox,Safari,Opera,Netscape,and Flock.IE has always been an inspiration for my life(:D ,Without ,IE I would never know,what’s the harshness of life and the bitter realities of life).

Ok,Let us leave that and go ahead.Have you ever wondered ,how to test the website/design you have recently coded into the browsers which are not on your system.I don’t know about you but I have been wondering for this.

Some times,Checking in Different Versions of same software (Like testing on Fire Fox 2.x and 3.x on same system) is quiet difficult.

So here is a website which provides the option to test your websites online.The only one restriction is ,It must be hosted some where on the web.

Check

http://browsershots.org/

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]


WordPress 2.6 problems in installing on addon domain

Jotted by brajesh on August 17, 2008

For the last two days,I was just wondering.I tried to install wordpress 2.6 and 2.6.1 both my add on domain with no luck.I have my hosting with BlueHost.com,The addon site was http://TheTurningBrain.com, and my main domain was http://BloggingVibe.com.I uploaded wordpress 2.6(later 2.6.1 too) to the TheTurningBrain.com folder,and tried to access the installation screen by typing in the url bar http://TheTurningBrain.com after one or 2 second,Instead of getting the installation screen,I was getting redirected to my main domain BloggingVibe.com. I tried it more than once(Let me mention here,I don’t use auto script installer,provided by the web host).

one time,twice,thrice,I just got wondered,Is there a problem with redirection mechanism.I deleted the files(wordpress files and folders) from TheTurningBrain.com folder and now,I was able to view the http://TheTurningBrain.com .I was not getting redirected now.So I again uploaded and tried but again the same result.I contacted the technical support person of bluehost.This guy called Anthony,Just annoyed me with his bloody naive answers.I was looking for the technical details and he was saying he is not a wordpress support and so.Anyway,I made my mind to change my hosting and re host at hostgator.I was planning that but also looking for other alternatives like DreamHost and yellowPages.

Suddenly,After two days,I don’t know what happened,Just for my curiosity I uploaded wordpress2.5.1 to my add on domain folder and tried to install.1.2.3. ….here is the famous five minute installation screen.OMG,I just found,It was a problem with wordpress 2.6.x which was not allowing me to install it on my add on domain.ahh..sorry bluehost guys for bothering you with the problem.

So what,Do I have to remain with the older version of wordpress?

No,not at all.I installed wordpress 2.5.1 successfully on my add on domain.After that I just downloaded worpress Auto Upgrade plugin and upgraded the site to wordpress2.6.1.Yes, It’s working and I have got a work around.

[blinklist] [Bloglines] [del.icio.us] [Digg] [dzone] [Facebook] [Ma.gnolia] [Mister Wong] [Reddit] [Sphere] [Sphinn] [StumbleUpon] [Technorati] [Email]



Get Adobe Flash playerPlugin by wpburn.com wordpress themes