Remove or Hide Admin Menu Links for Certain or Specific Users or Roles
The following snippet will let you remove as well as hide admin menu links for certain users or role.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
if (current_user_can('hide_jobs')) { add_action( 'admin_menu', 'my_remove_menu_jobs' ); function my_remove_menu_jobs() { remove_menu_page('edit.php?post_type=job'); remove_menu_page('edit.php?post_type=solution'); remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); // right now } } |
Source: Snipplr
Get all media attached to a post
The following snippet will allow you to get all media attached to a post
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$args = array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', ); $attachments = get_children( $args ) |
Source: Pippinsplugins.com
Filter Category from Blog Page
The following snippet will filter category from the blog page
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function exclude_cat($query) { if ( $query->is_home) { $query-> set('cat','-611'); } return $query; } add_filter('pre_get_posts','exclude_cat'); |
Source: brettwidmann.com
Custom Admin Login Logo & Alt Text
The snippet will allow you to have custom admin login logo and alt text
1 2 3 4 5 6 7 |
function change_wp_login_title() { echo get_option('blogname'); // OR ECHO YOUR OWN ALT TEXT }add_filter('login_headertitle', 'change_wp_login_title'); |
Source: Snipplr
Prev/Next wordpress loop links
Add the following snippet to previous/next loop links
1 |
<div class="navigation"><p><?php posts_nav_link(); ?></p></div> |
Source: WordPress Codex
Admin Footer Modification
1 2 3 4 5 6 7 8 9 |
function remove_footer_admin () { echo '<span id="footer-thankyou">Developed by <a href="http://www.designerswebsite.com" target="_blank">Your Name</a></span>'; } add_filter('admin_footer_text', 'remove_footer_admin'); |
Source: Snipplr
Query a custom taxonomy
The following snippet will allow you to query a custom taxonomy, using the taxquery parameter
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<?php // Example query to select all posts belonging to a custom taxonomy. $args = array( 'tax_query' => array( array( 'taxonomy' => 'TAXONOMY_NAME', 'field' => 'slug', 'terms' => 'TAXONOMY_SLUG' ) ) ); $the_query = new WP_Query( $args ); // The Loop while ( $the_query->have_posts() ) : $the_query->the_post(); echo '<li>'; the_title(); echo '</li>'; endwhile; // Reset Post Data wp_reset_postdata(); ?> |
Source: Snipplr
Remove Personal Options from Profile Menu
The following snippet will allow you to remove personal options from personal menu
1 2 3 4 5 6 7 |
function hide_personal_options(){ echo "\n" . '<script type="text/javascript">jQuery(document).ready(function($) { $(\'form#your-profile > h3:first\').hide(); $(\'form#your-profile > table:first\').hide(); $(\'form#your-profile\').show(); });</script>' . "\n"; } add_action('admin_head','hide_personal_options'); |
Source: Snipplr
Exclude Category from Feed
The following snippet will allow you to exclude category from feed
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function customFeedquery($query) { if(is_feed()) { $query->set('cat','-8'); // exclude category 8 return $query; } } add_filter('pre_get_posts', 'customFeedquery'); |
Load jQuery from CDN, fallback to local
Add the following snippet to your theme’s functions.php file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
/** * Load jQuery from Google CDN, fallback to local */ // http://wp.tutsplus.com/tutorials/load-jquery-from-google-cdn-with-local-fallback-for-wordpress/ if( !is_admin()){ // Don't do this for admin area, since Google's jQuery isn't in noConflict mode and will interfere with WP's admin area. $url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'; // the URL to check against $test_url = @fopen($url,'r'); // test parameters if($test_url !== false) { // test if the URL exists function load_external_jQuery() { // load external file wp_deregister_script( 'jquery' ); // deregisters the default WordPress jQuery wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js'); // register the external file wp_enqueue_script('jquery'); // enqueue the external file } add_action('wp_enqueue_scripts', 'load_external_jQuery'); // initiate the function } else { function load_local_jQuery() { wp_deregister_script('jquery'); // deregisters the default WordPress jQuery wp_register_script('jquery', get_bloginfo('template_url').'/js/jquery-1.6.2.min.js', __FILE__, false, '1.6.2', true); // register the local file wp_enqueue_script('jquery'); // enqueue the local file } add_action('wp_enqueue_scripts', 'load_local_jQuery'); // initiate the function } } |
Source: Snipplr
Photo Credit: Flickr/hackNY.org
WordPress Comment Plugins Collection
By The Editorial Team
On November 28, 2020
In Plugins
Here in this article, we have showcased the WordPress comment plugins collection.
NS Widget Recent Comments
This is a widget that let you show the latest comments from your WordPress Blog in a Sidebar area with comments author’s avatars.
More Info | Download
WP Advanced Comment
WP Advanced comment is a powerful and easy to use AJAX based comment system for WordPress with drags and drop custom fields.
More Info | Download
Facebook comments WordPress
The plugin will help you to display Facebook Comments on your website.
More Info | Download
Comment Images Reloaded
The plugin allow users to add photos or images to their comments.
More Info | Download
CommentPress Core
The plugin allows fine-grained commenting in the margins of a text. Use it to annotate, workshop or debate a social text in a social context.
More Info | Download
TinyMCE Comment Field – WYSIWYG
The plugin switches the comment field from a poor one into a rich WYSIWYG editor, using the internal TinyMCE Editor bundled with WordPress.
More Info | Download
Comment Notifier No Spammers
The plugin let you subscribe to comments and notify only approved comment authors, not spammers.
More Info | Download
Facebook Comments Importer
The plugin import Facebook comments into WordPress database.
More Info | Download
Heateor Social Comments
The plugin let you transform the commenting system of your website. You can enable Facebook Comments, Google Plus Comments, Disqus Comments and/or default WordPress comments simultaneously.
More Info | Download
Inline Comments
The plugin adds your comment system to the side of paragraphs and other sections (like headlines and images) of your post.
More Info | Download
Comments Ratings
The plugin let you add a rating system to your comments area and start displaying reviews from your visitors.
More Info | Download
Disable Comments
The plugin allow admin to disable comments, trackbacks and/or pingbacks globally or for specific post types, categories, tags, referrers and much more.
More Info | Download
HyperComments
The plugin replaces the native WordPress comment system with comments hosted and powered by HyperComment.
More Info | Download
Comments – WordPress plugin by Vicomi
The plugin is a free comment platform with a new cool, stylish graphic interface that replaces your default WordPress comment system.
More Info | Download
Facebook Comments by Vivacity
The plugin is a social plugin for enables Facebook users commenting on your site.
More Info | Download
Comment Images
The plugin gives readers the ability to upload an image to their comment right from the comment form.
More Info | Download