WordPress uses an XML-RPC interface by default. XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism. With WordPress XML-RPC support, you can post to your WordPress blog using many popular clients. You could even consider writing your own client application using Node.js. Let’s do a proof of concept.
How to Style Contact Form 7 Forms in WordPress
Contact Form 7 can manage multiple contact forms in WordPress, plus you can customize the form and the mail contents flexibly with simple markup. The form supports Ajax-powered submitting, CAPTCHA, Akismet spam filtering and so on.
The biggest downside is that the out of the box forms you add are very plain looking. Thankfully, Contact Form 7 can be easily styled using CSS in your WordPress theme. In this turorial, we will show you how to style contact form 7 forms in WordPress.
Display Random Posts in WordPress
This method requires you to add code to your WordPress theme files, so exercise caution. Continue reading “
Using the WordPress functions.php file
functions.php or the theme functions file is a template used by WordPress themes. It acts like a plugin and gets automatically loaded in both admin and front-end pages of a WordPress site. Usually this file is used to define functions, classes, actions and filters to be used by other templates in the theme. It can be used to add features and extend the functionality of both the theme, and the WordPress installation.
Use Google’s Copy Of JQuery in WordPress
Grabs jQuery from Google’s CDN which your visitors will hopefully have cached. This can then be called in your header with <?php wp_enqueue_script("jquery"); ?>
// Call the google CDN version of jQuery for the frontend // Make sure you use this with wp_enqueue_script('jquery'); in your header function itlc_jquery_enqueue() { wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); wp_enqueue_script('jquery'); } if (!is_admin()) add_action("wp_enqueue_scripts", "itlc_jquery_enqueue", 11);
Custom Excerpt Length in WordPress
Define how many words to return when using the_excerpt();
.
//custom excerpt length function itlc_custom_excerpt_length( $length ) { //the amount of words to return return 20; } add_filter( 'excerpt_length', 'itlc_custom_excerpt_length');
Post Thumbnails in WordPress RSS Feed
Include the post thumbnail in your RSS feed.
// Put post thumbnails into rss feed function itlc_feed_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '' . $content; } return $content; } add_filter('the_excerpt_rss', 'itlc_feed_post_thumbnail'); add_filter('the_content_feed', 'itlc_feed_post_thumbnail');
Customise WordPress Admin Footer
Change the message that appears in the admin footer, why not give yourself a credit for the theme?
// Customise the footer in admin area function itlc_footer_admin () { echo 'Theme designed and developed by <a href="#" target="_blank">YourNameHere</a> and powered by <a href="http://wordpress.org" target="_blank">WordPress</a>.'; } add_filter('admin_footer_text', 'itlc_footer_admin');
Theme the WordPress Login Page
Loads a CSS file into your login page so you can override default styles. Just add wp-login.css
into your theme folder.
// Custom CSS for the login page // Create wp-login.css in your theme folder function itlc_loginCSS() { echo '<link rel="stylesheet" type="text/css" href="'.get_bloginfo('template_directory').'/wp-login.css"/>'; } add_action('login_head', 'itlc_loginCSS');