How to add custom column to Custom post page list?

There is the hook manage_${post_type}_posts_columns which can be used to do just that. Basic example: function wpse188743_events_cpt_columns( $columns ) { $new_columns = array( ‘event_date’ => __( ‘Event Date’, ‘textdomain’ ), ); return array_merge( $columns, $new_columns ); } add_filter( ‘manage_events_posts_columns’ , ‘wpse188743_events_cpt_columns’ ); To fill the column with the related content you additionally have to make … Read more

Open media box library from link

By enququing an JS file we can do like this: <img src=”#” id=”img-src”> <a href=”#” id=”img-upload”>Add Image</a> Content of JS file jQuery(document).ready(function(e){ e.preventDefault(); jQeury(‘#img-upload’).click(function(){ var upload = wp.media({ title:’Choose Image’, //Title for Media Box multiple:false //For limiting multiple image }) .on(‘select’, function(){ var select = upload.state().get(‘selection’); var attach = select.first().toJSON(); console.log(attach.id); //the attachment id of … Read more

Redirect to other page when mobile

You could use wp_is_mobile with wp_redirect if ( wp_is_mobile() AND is_front_page() ) { wp_redirect( $location, $status ); exit; } You can add the js directly to a front-page.php or home.php file or enqueue it directly from either file. Example: add_action(‘wp_enqueue_scripts’, ‘load_script’); function load_script(){ wp_enqueue_script( ‘script-handle’, get_stylesheet_directory_uri() . ‘/js/your-script.js’, array( ‘jquery’ ) ); }

Post thumbnail is not shown in wp-admin

I figured out it was because of an script that was delivered with the Options Framework. There was a little piece of code in my functions.php which caused wrong javascript to be loaded. When you are having the same problem, be sure to search for something like wp_enqueue_media(); or something of the following script, comment … Read more

edit-comments.php in Admin – how to change ‘Comments’ title?

I think you need to change ‘Comments’ to ‘something’ but it from admin side. Please follow steps: 1> Go to Appearance -> Editor in your WordPress dashboard (In the list of theme files, on the right, click on “Theme Functions” to open your functions.php file) 2> Enter the following code in your functions.php file: add_filter(‘genesis_title_comments’, … Read more

Outputting complete custom comment form

Following was the HTML – <!– Comment Form HTML –> <div class=”sub-figure”> <div class=”sub-post-title”> <h4 class=”recent-title”>Comments</h4> </div> </div> <!– Leave a comment –> <div class=”sub-figure”> <div class=”sub-post-title”> <h4 class=”recent-title”>Leave A Comment</h4> </div> <form class=”form-inline”> <div class=”col-xs-12 col-sm-4 col-md-4 form-group”> <input type=”text” class=”form-control height-in” id=”reply-name” placeholder=”Enter Name”> </div> <div class=”col-xs-12 col-sm-4 col-md-4 form-group”> <input type=”email” class=”form-control … Read more