how can I change the background color of all posts on my server?
Set the background colour to the class “.post”, that’s the standard class for posts .post { background: #91C3C1 !important;
Set the background colour to the class “.post”, that’s the standard class for posts .post { background: #91C3C1 !important;
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’);
While I am sure that this is theoritically possible, I am going to say “No, not really”. If you look at the source, you can see that those brackets are hard-coded into a very complicated regex. I see no filters that will let you change that. The only reasonable way to approach this that I … Read more
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
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
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
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
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/
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
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