Admin Panel – Custom Menu Sub-Item LINK

Insert the URL of the page as the $menu_slug argument. Also note that user levels are deprecated, you should pass a capability instead. function add_custom_link() { add_submenu_page( ‘edit.php?post_type=cpt_custom’, ”, ‘Pending Posts’, ‘edit_posts’, ‘edit.php?post_type=cpt_custom&post_status=pending’, ” ); } add_action(‘admin_menu’, ‘add_custom_link’);

Automatically add image caption with values from a post parent field?

In the filter, you will need to find the post parent of $post, get the value of the custom field of parent post and then add that value to $post[‘post_excerpt’] (where the caption is stored): add_filter(‘attachment_fields_to_save’, ‘wpse_insert_custom_caption’, 10, 2); function insert_custom_default_caption($post, $attachment) { //Check if the $post is attached to a parent post if( $post->post_parent … Read more

Extend Screen Options

To change or extend the functionality of WordPress Core, WordPress relies heavily on actions and filters. I’ll assume you have basic knowledge of this, and if you don’t, you will after reading up on it in the Codex. render_screen_meta is a public method of the WP_Screen object. You can’t overwrite is by defining the function … Read more

Add Div to Comment Form

If you want to add some custom HTML between the </h3> and the <form> tags, you can try the following: /** * Add custom HTML between the `</h3>` and the `<form>` tags in the comment_form() output. */ add_action( ‘comment_form_before’, function(){ add_filter( ‘pre_option_comment_registration’, ‘wpse_156112’ ); }); function wpse_156112( $comment_registration ) { // Adjust this to your … Read more

Filter posts by custom taxonomy terms

This is expected output from what you have in your code. Never change the main query for a custom query on any archive page or on the home page. Custom queries are always troublesome as the main query is quite specific on these pages. I would advice you to rather use pre_get_posts to alter the … Read more

Make blog secret during design construction

You can use htaccess to disable public access. in your .htaccess file add this. AuthName “Secure Area” AuthType Basic AuthUserFile /path/to/htpasswd/file/.htpasswd AuthGroupFile /dev/null require valid-user don’t forget to change htpasswd address in this. You can create .htpasswd from here. http://www.htaccesstools.com/htpasswd-generator/ http://www.askapache.com/online-tools/htpasswd-generator/

WordPress generated links – menus and home_url() – not using https despite settings

This should not be default behavior. The home_url template tag retrieves the home URL for the current site, optionally with the $path argument appended. The function determines the appropriate protocol, “https” if is_ssl() and “http” otherwise. If the $scheme argument is “http” or “https” the is_ssl() check is overridden. http://codex.wordpress.org/Function_Reference/home_url There are filters involved so … Read more

Customizing default Mediaelement player

Okay so i did manage to add some custom css selectively on pages that load the medialement player by adding this to my functions.php file: function custom_player() { wp_enqueue_style( ‘custom-player’, get_stylesheet_directory_uri() . ‘/wp-mediaelement.css’ ); $custom_css = ” /*here goes the css*/ “; wp_add_inline_style( ‘custom-player’, $custom_css ); } add_action( ‘wp_enqueue_scripts’, ‘custom_player’ ); Like this by using … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)