Hide add new page button

This can be achieved easy enough with just CSS. First we are going to add a function that will output a class to the body tag based on what role the user is. Then we will enqueue a stylesheet to show up in the admin. Then use the class in the body to target and … Read more

When using https, wordpress doesn’t use https for CSS and JS, and admin doesn’t work. How do I fix this?

Check two things: in the wp-options table, the site URLs (in two places) should be the full URL, as in https://www.example.com . check the site’s htaccess file for proper rewrite of http to https. For a htaccess rule, this one works in most case: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Then look … Read more

How do I prevent the text overflow in menu?

If you use your browser’s inspector f12, you can see your list items have this CSS applied… .sf-menu li { white-space: nowrap; } You need to change it to… .sf-menu li { white-space: normal; } If you already created a child theme you can make the change there. Otherwise, in the admin go to Appearance … Read more

Changing Font-Size based on specific Font thru javascript

Not exactly what you asked for, but you can kind of “make sure” the user has the desired font through the @font-face css3 rule. According to caniuse.com about 95% of global users can use that css property, so it’s a good trade-off. Different browsers use different font formats however, so you’ll need to use http://www.fontsquirrel.com/fontface/generator … Read more

Styling readme.html in plugin?

It would be better to include your own CSS file that way you can: Use a relative path to your CSS. Avoid problems getting the path right to the wp-admin directory. Not all people put WordPress in the root directory, so your example above would break for them. Possibly redundancy by reusing the CSS in … Read more

How to add a body class based on a custom taxonomy term

What is the job of $section_name? Also you must get an return; you if statement kill the default return. It is important, if your if statement fails. maybe this works, but not tested, write from scratch. add_filter( ‘body_class’, ‘section_id_class’ ); // add classes to body based on custom taxonomy (‘sections’) // examples: section-about-us, section-start, section-nyc … Read more

Overwrite CSS with without deleting it

Assuming you have your child theme set up correctly, placing the following CSS in it which simply resets some of the preset values should get you all the way there. .et_pt_portfolio_entry { border: none; border-bottom: none; background: transparent; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; padding: 5px; margin-bottom: 7px; }

How to highlight all current categories when viewing a single post?

In order to assign the current-cat class to all categories of the current post we will extend the wp_list_categories function by means of a dedicated Walker. Suppose the current setup looks as follows: $args = array( ‘hierarchical’ => 0, ‘title_li’ => ”, ‘show_option_none’ => ”, ); wp_list_categories($args); Now we add the walker (which we will … Read more