QR codes are digital information which will be stored in image format. Many people are showing the QR code image in there site. You can very easily show the chart qr image in your post.
Show QR code in your wordpress post
You need to use the following code in your single.php file.
WordPress tutorial, How to wordpress secure file upload using apache rules, Here we given apache rule for secure your wordpress file upload functionality.
How to wordpress secure file upload using apache rules
Website security is most important point of any website. In wordpress we need to give 777 permission to wp-content/uploads folder. Some time we don’t want to give the 777 (read, write and execute) permission to folder due to security reason but wordpress do not allow you to upload images or media files to uploads folder.
Tip: Do not give 777 permission to wp-content/uploads folder. In stead change user ownership to apache folder.
Security
What you can do is. You can restrict other file types to upload in uploads folder using simple apache rule. following code you can use in .htaccess file.
Order Allow,Deny
Deny from all
<FilesMatch ".(jpg|jpeg|jpe|gif|png|tif|tiff)$">
Order Deny,Allow
Allow from all
Using above code you can secure your uploads folder and only selected files can be pushed into uploads folder.
WordPress hack, In this wordpress tutorial we given code and shown, how to get post data outside loop in wordpress. In wordpress theme you can get post data.
how to get post data outside loop in wordpress
Outside the loop you can get the a post data. you just need to copy paste following code in your theme file.
We strongly recommend to disable comments on wordpress pages. Many people want to disable the page comments. Using our code disable comments for your pages. Many people want to disable the page comments. Using simple code you can easily disable the comments for your pages by default.
how disable comments on wordpress pages
Here I written simple code. Using following code you can disable the comments for your wordpress pages. you need to just put following code into your functions.php file.
In Article, we given code for, how to change wordpress login page logo, Many people want to remove the wordpress login page logo and put their site logo. There are millions of wordpress CMS user. In Article, we given code for, how to change wordpress login page logo, Many people want to remove the wordpress login page logo and put their website logo.
how to change wordpress login page logo
Using following code you can easily add your custom logo in wordpress admin page. You just need to add the following code into your functions.php file.
function wplogo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/logo.png) !important; }
</style>';
}
add_action('login_head', 'wplogo');
Featured images are very important feature of wordpress. Many blogger use the featured images on top. With watching the featured images user got idea about blog post or your article. Some time we miss to upload the featured image.
How to show featured image in wordpress admin panel list
But in post list cannot able to see the featured image in admin panel.
I found very nice wordpress plugin which is helpful to show the featured image in admin panel.
Featured Image Column – Adds a column to the edit screen with the featured image if it exists.
This plugin has no options. It simply adds a column before the title (far left) the show’s the posts featured image if it’s supported and/or exists.
Add a defualt image simply by filtering you own image in. Use featured_image_column_default_image or filter your own CSS by using featured_image_column_css.
Add support for a custom default image
function my_custom_featured_image_column_image( $image ) {
if ( !has_post_thumbnail() )
return trailingslashit( get_stylesheet_directory_uri() ) . 'images/featured-image.png';
}
add_filter( 'featured_image_column_default_image', 'my_custom_featured_image_column_image' );
Add your own CSS to change the size of the image.
/**
* @use '.featured-image.column-featured-image img {}'
*/
function my_custom_featured_image_css() {
return trailingslashit( get_stylesheet_directory_uri() ) . 'css/featured-image.css'; //URL to your css
}
add_filter( 'featured_image_column_css', 'my_custom_featured_image_css' );
I found this plugin is really helpful to me. Using this plugin I can easily check the featured image.
Sometimes we create pages and posts which are unwanted. In this article, I given code for make empty wordpress trash automatically. Using code deleted items will automatically delete from trash. Open your wp-config.php file which is in the root directory of wordpress installation.
How to make empty wordpress trash automatically
define('EMPTY_TRASH_DAYS', 7 );
Above code will delete the comments from trash section after every seven days.
Seven days are safe to keep trash. This is simple but good option to keep in your wordpress blog.
One of my client faced issue with Autor drop down which is in Admin section.
Display the authors in dropdown menu using hooks.
While creating the New post there was problem with the Author field. There are hundreds of irrelevant selections (users) and it’s difficult to select the right one.
WordPress is by default showing all the users in author drop down. I don’t want to show the other users in author drop down.
I searched for wp_dropdown_users hook or filter. But I did not found any proper solution.
Following articles are found helpful to me.
http://wordpress.org/support/topic/filter-for-post-quick-edit-author-drop-down
http://codex.wordpress.org/Function_Reference/wp_dropdown_users
Using that code I modified the code and I am able to fix the issue. You can put following code in to functions.php file.
/*
* Hook for showing Admin and Author in Add new Post - Admin section dropdown menu
*/
function wpapi_override_wp_dropdown_users($output) {
global $post, $user_ID;
//get the Admin-role users IDs
$admins = getUsersWithRole('admin');
//get the author-role users IDs
$authors = getUsersWithRole('author');
//merge the array
$result = array_merge($admins, $authors);
//array converted into comma seprated string
$authorsall = implode(",", $result);
// return if this isn't the theme author override dropdown
if (!preg_match('/post_author_override/', $output))
return $output;
// return if we've already replaced the list (end recursion)
if (preg_match('/post_author_override_replaced/', $output))
return $output;
// replacement call to wp_dropdown_users
$output = wp_dropdown_users(array(
'echo' => 0,
'name' => 'post_author_override_replaced',
'selected' => empty($post->ID) ? $user_ID : $post->post_author,
'include_selected' => true,
'include' => $authorsall
));
// put the original name back
$output = preg_replace('/post_author_override_replaced/', 'post_author_override', $output);
return $output;
}
add_filter('wp_dropdown_users', 'wpapi_override_wp_dropdown_users');
/*
* Find User IDs by Role
*/
function getUsersWithRole($role) {
$wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
return $wp_user_search->get_results();
}
Using above code, you can load multiple role users in author drop down.
Here in wordpress tutorial, How to prevent wordpress images hotlinking but allow google. Steeling the blog images is very major issue in wordpress sites. Sometimes people are just linking the your site images in there site.You can read more about linking in above article.
prevent wordpress images hotlinking but allow google
Some sites are using your images and your bandwidth. If you are still want to use other images then use in your server and give credit to there owner sites.
Before every post visit wordpress cron is running and taking too much bandwidth. So we given trick and code to disable cron job in wordpress, which will disable wordpress cronjob. if you have a lot of visitors it can be a problem. I am convinced this is the reason why my admin has become glacially slow and my site often crashes when making edits.
how to disable cron job in wordpress
Disable the wp-cron.php
you need to add the code to your wp-config.php file.
define('DISABLE_WP_CRON', 'true');
If you have shared hosting then add the following cron job
php -q wp-cron.php
If you have your own server then you need to add the cronjob in crontab