Sep 242011
 

As you know that WordPress is a great organization which helps us launch blogs easily. In the beginning, I had to face some obstacles as beginner to set up a good site. I had to hack deep into the WordPress for acquiring some crucial changes. Here are 5 popular hacks and tutorials for you:

How to Remove Media Library Tab in the WordPress media uploader
:
If you are having a WordPress site with multiple users, then obviously you would like only new images to be uploaded by your users. To block them using images from Media Library just copy and paste this code in functions.php:
function remove_medialibrary_tab($tabs) {
unset($tabs[‘library’]);
return $tabs;
}
if(!current_user_can(‘edit_others_posts’)) add_filter(‘media_upload_tabs’,’remove_medialibrary_tab’);

Original Code taken from Superann.com

How to Remove Unwanted Meta Boxes from WordPress:

Having trouble while hiding unnecessary meta boxes for your users. Just copy and paste this code in functions.php:

add_action(‘admin_menu’, ‘dbt_remove_boxes’);

function dbt_remove_boxes(){
remove_meta_box(‘postexcerpt’, ‘post’, ‘normal’);
remove_meta_box(‘postcustom’, ‘post’, ‘normal’);
remove_meta_box(‘trackbacksdiv’, ‘post’, ‘normal’);
remove_meta_box(‘slugdiv’, ‘post’, ‘normal’);
remove_meta_box(‘authordiv’, ‘post’, ‘normal’);
remove_meta_box(‘commentstatusdiv’, ‘post’, ‘normal’);
}

Original code taken from Delux Blog Tips

How to Set Your Site’s Name in Dashboard Footer:

If you don’t want WordPress name and its Documentation and Feedback link in the footer of you dashboard. See below given code and making changes accordingly in Admin Footer.php. Find this line:

echo apply_filters( ‘admin_footer_text’, ‘<span id=”footer-thankyou”>’ . __(‘Thank you for creating with <a href=”
<em>http://wordpress.org/</em>”><em>WordPress</em></a>.’).’</span> | ‘.__(‘<a href=”<em>http://codex.wordpress.org</em>/”><em>Documentation</em></a>’).’ | ‘.__(‘<a href=”<em>http://wordpress.org/support/forum/4</em>”><em>Feedback</em></a>’) ); ?>
</p>

I’ve made some changes in the below given code and you can change according to your likings like:

<font color=”Blue”>echo apply_filters( ‘admin_footer_text’, ‘<span id=”footer-thankyou”>’ . __(‘Thank you for usin <a href=”http://wikitop5.com/”>WikiTop5</a>.’).’</span> | ‘.__(‘<a href=”http://wikitop5.com/submission-guidelines/”>Submission Guidelines</a>’).’ | ‘.__(‘<a href=”http://wikitop5.com/contact-us/”>Contact Us</a>’) ); ?>
</p>


How to Remove WordPress Standard Bio Section from Users Profile
:
If you are using a plugin to customize users’ profile pages, and don’t want the standard WordPress user bio section to appear in the profile edit screen. So, you add this to your functions.php:
<?php
// Callback function to remove default bio field from user profile page
function remove_plain_bio($buffer) {
$titles = array(‘#<h3>About Yourself</h3>#’,’#<h3>About the user</h3>#’);
$buffer=preg_replace($titles,’<h3>Password</h3>’,$buffer,1);
$biotable=’#<h3>Password</h3>.+?<table.+?/tr>#s’;
$buffer=preg_replace($biotable,’<h3>Password</h3> <table>’,$buffer,1);
return $buffer;
}

function profile_admin_buffer_start() { ob_start(“remove_plain_bio”); }

function profile_admin_buffer_end() { ob_end_flush(); }

add_action(‘admin_head’, ‘profile_admin_buffer_start’);
add_action(‘admin_footer’, ‘profile_admin_buffer_end’);
?>

This is the Original Source: http://wordpress.org/support/topic/remove-the-bio-section-from-user-profile?replies=5

How to Insert Ad. Anywhere Within Your Post Content:
You must have seen lot of blogs with ads after 1, 2 or middle of the blog. To paste ad. anywhere within your blog >Open single.php and look for the content code that would look something like this:
<?php the_content(); ?>

Replace it with this code below:
<?php
$paragraphAfter= 1; //display after the first paragraph
$content = apply_filters(‘the_content’, get_the_content());
$content = explode(“</p>”, $content);
for ($i = 0; $i <count($content); $i ) {
if ($i == $paragraphAfter) { ?>

<div>Your Text / Ads Go Here</div>

<?php }
echo $content[$i] . “</p>”;
} ?>

You may change the number of paragraphs by changing $paragraphAfter line.

Original Source: WPBeginner.com

If you have some more information, share with us via comments.

You can also follow News of Delhi  on Twitter and Facebook.

Related posts:

  One Response to “Top 5 WordPress Tutorials and Hacks Which you Love to Read”

  1. Biggest problem of WP is blog oriented. In case of multi contributors, where you don’t want any other members to have access to dashboard may be except Administrator & Moderators. WordPress should cater to custom login form (where fields could amended or added & deleted) and front end posting option for other members except administrators & moderators.

    Presently it could be achieved thru plugins like Ucan Post (for front end posting, depending upon user priviledges) and Theme My Login for customised login and profile. Thus you can allow posting by multimembers while preventing access by them to dash board. But only registered members after they are logged in will be allowed to make post with or withou admin approval. This is how i have achieved it on my group website a87classdotinfo

Sorry, the comment form is closed at this time.