Showing posts with label wordpress. Show all posts

Every User Can Upload Images in WordPress Blogs



It may be WordPress security measure (is it? Really?). The users have different roles. Each role gets a certain set of privileges. But not having option to upload images for contributors is really hindering, isn’t it?


                                            where is the add images option?
  
                                                          



Image courtesy of David Castillo Dominici / FreeDigitalPhotos.net


If you are the only person to compose and publish posts, there’s no problem. You’ll never need to allow contributors to upload image. But what if it is a multi-authored blog? What if you welcome lots of guest posts? Is it not nuisance to receive preferred images in email, upload them and publish in the post written by your contributors?

I write posts for some great blogs – Ileane’s BasicBlogTips, Stephane’s Dukeo, Enstine’s emFastIncome, Erik’s NoPassiveIncome.com & Bashir’s Ajnabii. I will be writing soon for Devesh’s WPKube. And the problem is not less obstructing to me as well. In some cases, I compromised with the image the publisher set for my post and in some other cases I sent the images separately and requested them to fix it for me. I wish if they allow contributors to upload image.

Simply wonder why we not allowed to upload images.

When I was fixing images for Ambika’s post, I planned to look for ways so that the Bivori contributors can upload and insert images in their post. I went to Mr. know all – Google, and had a brief conversation.

Though the problem looks really big, the solution is startlingly simple! You can allow contributors to upload images within a couple of minutes if you’re not scared to touch the code of your theme

Okay, don’t be afraid, it is not that risky and we’ll not tough any core files!

How to  upload images?

Okay, to make this change in WordPress, you need a code snippet and know where to paste the snippet. Every theme has a functions.php file to add some codes to extend functionality of your blog. Find that file.

I got to it through Appearance » Editor » Theme Functions (functions.php)

Did you get that file? Does it already contain some codes? Fine, no problem. You’ll add the new code at the end of this file.

Now let’s fetch the required code.


if ( current_user_can(‘contributor’) && !current_user_can(‘upload_files’) )
add_action(‘admin_init’, ‘allow_contributor_uploads’);

function allow_contributor_uploads() {
$contributor = get_role(‘contributor’);
$contributor->add_cap(‘upload_files’);
}


Copy above code and paste it at the end in your functions.php file. Great! You did it!

Now your guest authors will be happy because they know what image goes best at where in their post. They are allowed to upload images in their posts!

Adore WordPress But Won’t leave Blogger



Yeah! I love using WordPress and I’ll definitely endorse it; suggest it to the newbie bloggers who keeps asking me whether they should go ahead with free blogging platform i.e., blogger or get themselves self-hosting to start WordPress blog. There are good reasons behind this; however, this doesn’t mean I don’t like blogger. I do like blogger to but I don’t love it. Oh yes! I hope you’re aware of the stiff difference between these two words – like and love. If you’re not, please open any English dictionary and find out what do they exactly mean. That’s not our subject of discussion today. Right? So, why do I like blogger?



 

Let’s find out why I love WordPress but still like blogger. Even if you’ve zero knowledge about how WordPress works, I would recommend you to start using it and you’ll understand why when you’ll reach the end point of this article. Nobody is born genius and I or you; both of us are not exception to this.

Customization in WordPress and Blogger

You don’t need to be a coder or knowledgeable person to start using WordPress. Installing WordPress through cPanel is the task that you can complete within 2 minutes. Yes, that’s right. Exactly within 2 minutes.

So, assuming you’re not good at coding, you can simply pick up ready-made premium or free WordPress themes and apply to your blog. Once you’ve install the theme, you can go ahead in widgets section to add sidebar widgets. You can also add navigational menu through the appearance > menu. It’s that easy.

When it comes to blogger, there are bunch of free themes available over at various websites. For instance, you can check out these free and best blogger themes of 2013. These themes are mostly free but the customization needs you to have basic knowledge of web languages such as js, HTML and CSS. In fact, adding a navigation menu would also require you to edit and find the places. That’s not recommended when you’re not good at coding. A small mistake of missing simple semi colon (;) would drag your blog in big mess.

SEO Benefit

WordPress is way better than blogger when it comes to comparing the SEO benefit. WordPress lets you add your custom Meta title, description and keywords for each post. Besides, you can also add custom sitemap.xml and define the category and tags. Blogger still lacks some of these basic features and therefore it is not recommended to go with blogger if you’re SEO centric or care about SEO a lot.

Additionally, WordPress lets you change the permalink structure. What does it mean? It allows you to either display the URL of the post with data, month, and category or with simple blog post title. You can’t really change the URL structure in blogger, however you can change the content of the URL.

Plugins

WordPress offers a wide range of plugins and short-codes (through themes) which helps in improving the user friendliness of a blog. These plugins can help you every aspect. For instance, I’m using AffiLinker on my blog to convert the keywords into affiliate links automatically.

Not to mention, these plugins are exclusively available for WordPress. You don’t have any plugin support for blogger, however there are bunch widgets that you can add but the number these widgets and quality is really disappointing.

Multi-authors

When you’re planning to start a multi-author blog, WordPress is the best solution. You can define roles for each authors and you can also restrict them with certain capabilities so that your blog don’t end up with something fishy.

Blogger does lets you add authors through settings but it’s really difficult to manage them. You can’t really have a good control over them as you get in WordPress.

Hosting & Bandwidth

This is one point where I would say – blogger takes it away all the way down. This is probably the most critical reason to why newbies as well as others love using blogger. Hosting your media, images and everything that keeps your website running is totally free. All your media is stored in Picasa web albums. Also, you don’t really need to be concerned about how much bandwidth your blog is using. It will be taken care of by Google’s own servers.

WordPress doesn’t offer this for free. You need to buy self-hosting package in order to host your images and videos. You also need to take care of bandwidth. This would certainly cost you something around $100.

Security

In terms of security, blogger is one step ahead of WordPress. All the database files are stored internally inside the Google’s server. Neither you nor the attacker is aware of where they are stored. So, there is absolutely no chance of getting attacked by any brute force technique.

That’s certainly not the case with WordPress. All your database files and images are accessible to you as well as anyone who has the permission. If an attacker is able to get those permissions, it won’t take more than two minutes to see your blog resting in peace. Moreover, you can have a look to OddBlogger’s review of the best WordPress security plugin to protect your blog from most of the attacts.

That’s all from the desk today. The last two points especially the security topic sounds important to many of us. Don’t get me wrong that WordPress blogs can easily be attacked. You need to put a proper armor around your blog to save it from the attacks and it can be achieved by using plugins and .htaccess modifications.

As for the hosting and bandwidth usage, I would suggest you to invest in that hosting package which offers virtually unlimited space and bandwidth. You won’t feel any problem till the time you’re receiving views less than 8000-10000 per day (number varies with each hosting provider).

I hope you now know why I’m saying – I love WordPress but I won’t deceive blogger. Let me know your views about these two platforms. Which one you’re using?

Qicktips : How To Detect Visitor Browser Type ( WordPress )



Sometimes we need to serve specific content or tweak to certain Web browsers. There are several ways to do so. For example, we can use the JavaScript BrowserDetect.browser function. We can also use the following comment tags to exclusively target Internet Explorer.

 

Modernizr is useful for feature detection of the browsers, so that we are able to patch the functionalities that are not supported. We can also use CSS3 media query, though it is not designed to retrieve browser information, it is useful to address the website presentation particularly in mobile browsers.



PHP Browser Detection

However, all of those methods are only altering the front side, while the actual content in the document’s markup remain unaffected. Say, we have two <div> elements one for Internet Explorer, and one for the other. These two elements will actually remain on the document regardless of the browsers.

In some cases, these methods might not be the ideal solution. So, the only viable option would be to use the server-side language, like PHP. If you are using WordPress, there is an easy to do so with a plugin called PHP Browser Detection.


Conditional Functions

When this plugin has been activated, it will give you nothing in the Dashboard. Instead, it provides several conditional functions to use in your theme files – such as page.php, index.php and others. It allows detection in all popular desktop and mobile devices – such as iPad and iPhone.


Basic Usage

Let’s see some usage examples. Say, we want to show notification only to Internet Explorer users. We can write something like this inside the header.php under the <body>.


With a few style adjustment in the stylesheet, Internet Explorer users will see the following.


But, when we see it in other browsers – Firefox, Opera, Safari and Chrome– the notification markup is not generated.


As mentioned, we can also target for mobile devices, which is very useful to optimize your WordPress site on the mobile platform. Assuming that you have enabled the post thumbnail support in your theme, we can add the following function to your index.php to serve lower image resolutions in mobile device, and higher resolutions for desktop browsers.


Those are only a few examples, head over to the WordPress.org page to see about this plugin in more detail.









Related Posts Plugin for WordPress, Blogger...

- Copyright © 2013 All Ping