Yearly Archive
for: ‘2011’

WordPress get user id by login name

If you have ever wondered how to get the user id from user login name in wordpress, here is the answer. By using get_userdatabylogin $user = get_userdatabylogin(’loginname’); if($user){ echo $user->ID; }

Read More

Dynamic WordPress URL

If you have more than one domains (addon domains) for the same wordpress site you can add the following to your wp-config.php to override the default WP_HOME and WP_SITEURL definitions with dynamic host address. Adding these two definitions also reduces the number of database queries and thus improves site performance. Here is an example (note [...]

Read More

Changing the site url in WordPress

If you move your wordpress installation to a new location (a new domain or another folder), you need to change all urls within your wp database. You might find some plugins to do this task but in my opinion the easiest way to do this is by using phpMyAdmin. Just run the following SQL Statements [...]

Read More

Allow iframe in WordPress Posts

If you’ve ever tried adding an iframe to your WordPress post, and then switched the TinyMCE editor to Visual mode, you’ve found that the editor strips out your iframe code. This can be annoying. Just add this snippet to the functions.php file in your theme folder to prevent TinyMCE from killing your iframe.   function [...]

Read More

Launch Fancybox automatically

Fancybox currently does not directly support a way to automatically launch. The work around I was able to get working is creating a hidden anchor tag and triggering it’s onclick event. Make sure your call to trigger the onclick event is included after the jquery and fancybox js files are included. The code I used [...]

Read More

Decode HTML entities with jQuery

Decoding HTML entities can be so easy with jQuery. The following code snippet converts all HTML entities to their applicable characters:

Read More
 
© 2010 onYou GmbH. All Rights Reserved