Attached images in WordPress are handy while using with theme development. Using this code you can get attached images from a page. We are using this code inside a wordpress page templates and we will get its attached images via media option.
Show Meta Box if a specific page template is used (jQuery)
Using this code you can show WordPress meta box for a specific template selected. To do this add this code in to your themes function.php file <?php add_action( ‘admin_head-post.php’, ‘metabox_switcher’ ); add_action( ‘admin_head-post-new.php’, ‘metabox_switcher’ ); function metabox_switcher( $post ){ #Locate the ID of your metabox with Developer tools $metabox_selector_id = ‘about-banner-image-meta’; echo ‘ <style type=”text/css”> […]
How to Create a Shortcode to Display Custom Post Type
In this code snippet we are exploring how we can create a shortcode to display custom post type. With this code snippet we are utilising WordPress shortcode API. What is WordPress Shortcode API The API enables plugin developers to create special kinds of content (e.g. forms, content generators) that users can attach to certain pages […]
How to Hide a Specifc user from WordPress admin panel
In this code snippet i will give you a small tweak over WordPress admin area. Using the code you can hide a user from WordPress dashboard. Why its Needed? If you want add an admin user to your clients WordPress site. There many be a chance of them to delete your user account after you deliver […]
Language Based Page Display Using WPML Plugin
In this post are looking for language specific query in WordPress. WMP is the top multilingual plugin in WordPress. If you are developing a multi-language site and you want display content only for a specific language this code snippet will help you. <?php $query = new WP_Query( ‘page_id=’.icl_object_id(221,’page’,true) ); while ( $query->have_posts() ) : […]