How To Fix WordPress Gallery Issues Without A Plugin

One of my friend told me that he is fed up with adding one post another as he couldn’t find a way to add images one after another (full size) without linking to original images especially when he adds a gallery. By default if you insert a gallery in WordPress post, the images are linked to itself. If you are showing thumbnails of large images on your post page then linking to original size image is a great option but what about showing full size there and then. In that case you don’t want to add a link to image you have to install a plugin to do so. Installing plugins for simple tasks is not what i have in mind. Here is how i fixed few issues pertaining to WordPress gallery shortcodes.

How To Insert Full size Images In WordPress Gallery

Inserting a full size image as gallery in your post is easy you have to do the followings:

  1. Upload Images In Gallery
  2. Insert Gallery In your post
  3. Go to HTML Menu to edit gallery shortcode
  4. Your Inserted Gallery shortcode will look something like this {gallery}
  5. Edit the gallery shortcode, something like this {gallery size="full" columns="1"}

The above modified gallery shortcode will insert images in your post one after another. But the inserted images will be linked to themselves.

Remove Image Link From WordPress Gallery Shortcode

Removing image link from WordPress gallery shortcode is easy, just write this filter in your theme’s functions.php file

Removing Embedded CSS Form WordPress Gallery Shortcode

When you attach a gallery to your post, wordpress automatically embed a CSS within your post. If you are using a customized wordpress theme then this embedded CSS will cause problems. The following code got rid of embedded CSS from wordpress posts

All i have to do now is to create the following CSS classes in styles.php


.gallery {}
.gallery-item {}
.gallery-icon {}
.gallery-caption {}

How To Call Gallery in Post Template

If for some specific reasons you want to call gallery in your post template via code you can do so by calling the following:

I hope the above wordpress gallery hacks will solve your specific gallery related issues. Please leave me a comment and let me know if you face any issues implementing the above in your wordpress theme. Subscribe our RSS to receive latest wordpress updates.

wordpress Posting Content via XML RPC

WordPress XMLRPC – Posting Content From Outside WordPress Admin Panel

Many WordPress blog owners these days prefer to post their blog content from outside. This facilitates the site owners to post blog posts without even loging into their WordPress admin panel. WordPress supports XMLRPC which can take requests and perform specific operations i.e. ‘Add Post’, ‘Edit Post’, ‘View Recent Posts’ or ‘Save a draft’.

Lets start coding now, but before we go into any details lets ensure that our WordPress installation is allowing XMLRPC (default is turned off). Go to WordPress Admin => Settings => Writing and ensure the XML-RPC is enabled. Click save after checking the enable box. We are good and our WordPress is ready to take XML-RPC commands.

XML-RPC is by default enabled in WordPress 3.5+ that’s cool. On the other hand what if you are not using XMLRPC you can anytime disable it like this. Just place the following line of code in your themes functions.php file and you are all set.

But for the sake of our article, i assume you will not disable XMLRPC.

We will use IXR Library to incorporates both client and server classes, as it is designed to hide as much of the workings of XML-RPC from the user as possible. A key feature of the library is automatic type conversion from PHP types to XML-RPC types and vice-versa. This should enable developers to write web services with very little knowledge of the underlying XML-RPC standard.

Download IXR_Library.php.inc (rename it to IXR_Librabry.php.inc) or download the latest version from Incutio

Add a WordPress Blog Post via php

Get Recent 10 WordPress Blog Posts via php

Edit WordPress Blog Post via php

Posting Images and Marking Featured Via WordPress XMLRPC

The new wordpress thumbnail feature is so great, now all you have to do is upload an image and mark it as featured. If this is something you are looking for via WordPress XMLRPC then look at the following code

Code Explanation

Here is how it works

1. We are assuming you have already uploaded the file in your application, all you need to do is read the image file by this code

2. Connect to your WordPress XMLRPC

3. Now, upload the file to wordpress via XMLRPC

Finally lets see the full code example, how this uploaded image is marked as featured in your WordPress site.

Based on the code given below you can define your own logic of posting images in your article. Suppose you want to show the uploaded image within your content, you can append the $thumbnail_image within your $body object e.g.

I have made a centralized Word-press control panel where i am posting blog posts in more than 20 different blogs using the same admin area. There is no need to log into 20 blog accounts to post my content. I would love to hear your thoughts on this. Please leave me a comment and let me know. Don’t forget to subscribe our RSS to receive latest updates.our RSS to receive latest updates.