How can I add a CSS rule to edit.php?
Creating Admin Themes article in Codex shows you how to add css styles to admin pages
Creating Admin Themes article in Codex shows you how to add css styles to admin pages
Simple fix: <div <?php post_class(“clearfix”); ?>> See post_class() for more details
i needed something similar and i’ve come up with this simple little function that make things easier : function is_child_post($parent_ID = null) { global $post; if (isset($parent_ID) && $parent_ID != null){ return $post->post_parent == $parent_ID; } return $post->post_parent > 0; } Usage: check if a post/page/custom has a parent: if (is_child_post()){ //yes we have a … Read more
WordPress already ships with jQuery. There is no need to include it in your theme. Javascript Let’s say your jquery.tabify.js file is located in /js/jquery.tabify.js in your theme. Include the following code in your functions.php file: function jquery_tabify() { wp_enqueue_script( ‘jquery-tabify’, get_template_directory_uri() . ‘/js/jquery.tabify.js’, array( ‘jquery’ ) ); } add_action( ‘wp_enqueue_scripts’, ‘jquery_tabify’ ); This will … Read more
I don’t think you want get_stylesheet_uri, which will return the complete stylesheet URL including style.css. You want get_stylesheet_directory_uri, which will give you the path up to the child/parent theme stylesheet directory but not the trailing style.css, and which is the function used by the Roots theme per the code you posted. wp_enqueue_style(‘fsc’, get_stylesheet_directory_uri().’/abcdefg.css’, false, null); … Read more
W3 Cache will do this for you
Use the dynamic_sidebar_params filter. The following code adds classes to say whether the widget is odd or even, what index it is in the sidebar, and what sidebar it’s in. Note: the str_replace(“class=\””, “class=\”$class “, $before_widget); code below depends on your before_widget using double quotes — it probably should be done with a regular expression … Read more
Bulma.io is likely to conflict with any styling that comes from Genesis (or any other theme). If you understand HTML/CSS, I recommend using bulma without any other themes/frameworks to avoid conflict/bloat. If you rely on any visual page builders, I would avoid CSS frameworks like bulma and just stick with themes. I’ve done a lot … Read more
Why are my styles being applied to the admin area? Assuming that is all of the code, it is because you are enqueueing the styles globally. You need to hook that to wp_enqueue_scripts, which will only load on the front end. wp_register_style( ‘main-styles’, get_stylesheet_directory_uri() . ‘/css/styles.css’, false, ‘1.0.0’, ‘all’); function enqueue_script_front_wpse_84975() { wp_enqueue_style(‘main-styles’); } add_action(‘wp_enqueue_scripts’, … Read more
You can do this using WordPress’s handy body_class() function. Depending on whether and how it is used in your theme, it may already be giving you what you need. Here’s how to find out: Check the source of your page to see if the <body> tag in your category archive pages has any classes containing … Read more