CSS styling not working in a custom metabox

The metabox div gets an ID of ‘meta_’ + your metabox ID, thus: Sorry, that was me looking at my own metaboxes, forgetting that I actually prefix them like that to differentiate the container from elements within the container 🙁 Let’s work through your code and see if we can find the answer. First, your … Read more

Integrating CSS Into a WP Function Call [closed]

Apart from the fact, that the conditional is based on a WordPress option, this is pure PHP, but anyhoo: <?php $show_views = get_option( ‘to_post_views’ ); if ( ‘Yes’ === $show_views ) { echo ‘<div class=”postviews”>’ . getPostViews( get_the_ID() ) . ‘</div>’; } ?>

Image width issue in IE [closed]

The issue was related to width: 100%; being applied by WordPress to all images. The code below fixes this issue – i applied this only to IE 8 and lower, as these are the browsers that have issues with the code. img.size-full, img.size-large, img.header-image, img.wp-post-image { max-width: none !important; }

CSS changes not taking effect [closed]

A couple of thoughts for you. –Are you creating a new theme from scratch? If so, drive on. If you are modifying an existing theme, changing another’s theme style.css file can be trouble. If you are modifying an existing theme, stop what you are doing, and spend 30 (yup, 30!) minutes to learn how to … Read more

Is it possible to make invisible a div only on certain pages using CSS?

You need to target the specific pages with the build in body_class selectors. Themes have a template tag for the body tag which will help theme authors to style more effectively with CSS. The Template Tag is called body_class. This function gives the bodyelement different classes and can be added, typically, in the header.php’s HTML body tag.

theme injecting css into wp-admin

The problem is that you are enqueue the CSS file of your theme outside any of the recommended actions. If you want it to be added only in frontend, you should use wp_enqueue_scripts action: add_action( ‘wp_enqueue_scripts’, function() { wp_register_style( ‘mainstyle’, get_stylesheet_uri()); wp_enqueue_style( ‘mainstyle’, get_stylesheet_uri()); });

Installing non-standard fonts [closed]

If your font is free convert it http://onlinefontconverter.com. open type can be used in website try appending format(“opentype”). I will strongly suggest converting this from from given link, if your font is free and open source. @font-face { font-family: UtopiaStd; src: url(‘/wp-content/themes/opti-child/UtopiaStd-Regular.otf’) format(“opentype”); }