From WordPress 3.8 version came with new dashboard style. For Get back single-column dashboard in Latest WordPress, So you can use our code which can useful for every wordpress devloper.
Get back single-column dashboard in Latest WordPress
For getting back the single-column dashboard in WordPress 3.8, you need to add the following code in functions.php file.
// force one-column dashboard
function wpapi_single_screen_layout_columns($columns) {
$columns['dashboard'] = 1;
return $columns;
}
add_filter('screen_layout_columns', 'wpapi_single_screen_layout_columns');
function wpapi_single_screen_layout_dashboard() { return 1; }
add_filter('get_user_option_screen_layout_dashboard', 'wpapi_single_screen_layout_dashboard');
There is custom post type support added from wordpress 2.9 in wordpress. Many times we create the different types of post type in wordpress and show it i different way. We use the different styles for showing the content types..
Add different Editor Styles for Custom Post Types in WordPress
In wordpress we have the visual and html editor. For adding the different styles for custom post types just open your functions.php file put the following code in that file.
function my_editor_style() {
global $current_screen;
switch ($current_screen->post_type) {
case 'post':
add_editor_style('editor-style-post.css');
break;
case 'page':
add_editor_style('editor-style-page.css');
break;
case 'product':
add_editor_style('editor-style-product.css');
break;
case 'shop':
add_editor_style('editor-style-shop.css');
break;
}
}
add_action( 'admin_head', 'my_editor_style' );
If you are not wordpress developer then dont use above code. In purabtech.in site you will find many wordpress tutorials and tips and hacks and plugins. Please write to me on support@purabtech.in
For increasing traffic of website. It is good to send email to users about new post. we have script for Send email to site users about new wordpress posts.
There are many wordpress plugins available for sending email but I given small code for sending email to wordpress users without using any wordpress plugins
If you are wordpress developer then only use following code. Open your functions.php file from your theme and put following code in that file. Just copy and paste the following code on your functions.php file:
function send_email_users($post_ID) {
global $wpdb;
$usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;");
$users = implode(",", $usersarray);
mail($users, "New Article is Published", 'A new article have been published on http://www.purabtech.in. Please visit');
return $post_ID;
}
add_action('publish_post', 'send_email_users');
You just need to change my domain name to your domain name and put that in your functions.php file. If you are having any issues then Please write to me.
This wordpress hack, tip or trick written by wordpressapi.
Here is some very useful links for wordpress.
Check Following articles for great wordpress hacks of the all the time.
wordpress tutorial for, change Visual Editor Font Size without wordpress plugin. need to open your functions.php file and put following code in that file.
change Visual Editor Font Size without wordpress plugin
You need to open your functions.php file and put following code in that file.using following code you can change the font size of editor.
Note: If you are not having knowledge of wordpress code and php then dont use the code.
WordPress tutorial for, disable html code in comments wordpress. We given code sample for functions file to prevent html code in wordpress comments section.
If you are wordpress developer then only use following code. Open your functions.php file from your theme and put following code in that file. Just copy and paste the following code on your functions.php file:
In many wordpress premium theme search form added in navigation menu and many clients are demanding for same So here we created tutorial for adding search form.
WordPress tutorial for, add search form to wordpress navigation menu. If you are wordpress developer then only use following code. Open your functions.php file from your theme and put following code in that file.
add search form to wordpress navigation menu
Using following code in you can add the search form in your menu bar.
Many people having issue when creating the wordpres theme and show search widget in theme. wordpress tutorial, adding custom styles to search widget in wordpress. In this tutorial we will show you how to show search widget with our custom styling.
adding custom styles to search widget in wordpress
you can override the default wordpress search widget.
disable wordpress post revisions and increase wordpress performance. For improving the WordPress website or blog performance you need use following method.
WordPress saves the post revisions after every 2 min. That takes so much mysql storage.
To save MySQL storage, some WordPress user will be happy using this method, this method is Disable WordPress Post Revision.
how to disable wordpress post revisions
Why we need disabled this featured?
It’ because WordPress created such as dummy data revision and this one make our table sized increased. And if you have limited space, this is bad idea, and of course disable Post Revision also made your WordPress running faster.
Open your wp-config.php file and put the following code in that file. If you are not wordpress developer then dont use following code. Please consult with any wordpress developer for this code.
wp-pagenavi is most popular. wordpress pagination style without wordpress plugin, We need to install wp-pagenavi wordpress plugin for pagination styling. When we think wordpress pagination style then first thing came in mind which is. We need to install wp-pagenavi wordpress plugin for pagination styling. There are multiple pagination plugins available for pagination styling but wp-pagenavi is most popular.
wordpress pagination style without wordpress plugin
I always recommend wordpress theme developers to not to use the wordpress plugins as much possible because any wordpress plugin will install the extra unuseful code also.
Here in this article I am giving you the example about wordpress pagination without using any wordpress plugin.
Just open your functions.php file and put following code.
When you put some URL and email address you need to manually add the link URL to that text. This action always takes the some time of wordpress blogger. WordPress has facility to add the links to your URL and email address automatically.
convert plain text URI to HTML links in wordpress
This facility is available in wordpress since wordpress 2.7 version but many wordpress theme and plugin developers never used this functionality.
WordPress provides the make_clickable() function for convert plain text URI to HTML links. This function able to convert URI, www, ftp, and email addresses. Finishes by fixing links within links. You just need to pass the string parameter to this method.
More detail information you can find in following file.
wp-includes/formatting.php.
You can use this method in your functions.php file also. Use the following code.
add_filter('the_content', 'make_clickable');
By using this code you are able to covert the URI, www, ftp, and email addresses in to link.
If you are having any issues or question about make_clickable method then please write to me.