Tag Info

Hot answers tagged

7

Modify a registered style's path I wanted to tweak the path to one of the WordPress admin stylesheets so i could keep requests down, and because it makes little sense to include two stylesheets, when the one i'm calling redefines all the styling in the stylesheet enqueued by WordPress. The idea is basically to re-point the existing style at a different ...


7

Theme stylesheets aren't usually enqueued, they're normally loaded using.. <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> So naturally you don't see them(it) in the styles array.. You can of course(if you prefer) use an enqueue instead.


5

Technically speaking, there is no "standard" Post Format. Rather, "standard" is simply the default - as in, no Post Format type is defined. If no Post Format type is defined, get_post_format() simply returns null. I would suggest re-factoring your code above, and re-naming your icon images using the exact Post Format string. That way, you could do: ...


5

The background is a option. You can set colors and also images. See in the Administration area, Appearance --> Background Also you can use the Live Preview link on the theme and customize the background and other otpions.


3

I would put all the common css in the theme's style.css, and create separate stylesheets for the color options. I would also put color options in their own folder with the images for that style. This way you can keep the filenames the same between color options to make maintaining the code a little easier. If you wanted to separate common.css from ...


3

When your users really need 30 lines of custom CSS, your theme is flawed. Create a set of predefined styles instead (dark and light scheme, sans and serif fonts etc.) and prepare your main stylesheet for these cases. You can hook into body_class then and add the classes you need to get these styles. Adjustments for your users should be very minimal then. ...


3

There are many plugins for that mostly based on shortcodes i use either Google Syntax Highlighter for WordPress http://wordpress.org/extend/plugins/google-syntax-highlighter/ SyntaxHighlighter Evolved http://wordpress.org/extend/plugins/syntaxhighlighter/


3

You can change the order of the scripts but can't have one script load before anything else. The HTML 5 enabling script is IE conditional so you probably don't want to use wp_enqueue_script as it would load for all browser users which isn't necessary. It's ok to hard code it in your themes header. Even Twentyeleven does it this way. Also there is nothing ...


3

Method 2 You can enqueue all of your stylesheets form the same place even controlling where the stylesheets load by means of template conditionals, which is convenient and prevents a lot of mess in your <head>. You can remove enqueued stylesheets if you need to via a plugin, for example. Enqueued stylesheets are child theme friendly as they can be ...


2

If it's purely for setting the style of the text you may want to use JavaScript/jQuery instead. Here's a quick sample that would replace all instances of "ipsum" with <span class="red">ipsum</span> And the full code: // Find text in descendents of an element, in reverse document order // pattern must be a regexp with global flag // function ...


2

In short: make sure that the Jetpack plugin is installed and enabled, and also that the Jetpack Lite plugin is not enabled. I found out that Edit CSS is provided not by WordPress itself but by the plugin Jetpack. Jetpack was still installed; I had a Jetpack menu right below Dashboard. But when I opened it, I saw only two items, “WordPress.com Stats” and ...


2

h2 and h3 are not html classes, they are html tags. That said, does not exists a default html tag for the widgets, because the format used to output widgets title is set when the sidebar is registered (look at 'before_title' argument). So how title is shown is theme related and sidebar related, does not depends on widgets. An easy way to change the html ...


2

First of all, do not change any files in the twenty thirteen theme. The reason been, twenty thirteen is updated regulary, so if you made changes to the theme, you WILL loose everything you have done to the theme. You should create a child theme You need to change the function that set the header height to get your image correctly cropped. This function can ...


2

I'm not sure if this question is still relevant or not (so I'm posting for future reference for people), but there is a way to define a css file for the TinyMCE editor in your plugin by using the mce_css filter. For a quick example, I'll take an excerpt from the WordPress documentation: function plugin_mce_css( $mce_css ) { if ( ! empty( $mce_css ) ) ...


2

using: http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior and the $strip_teaser parameter: http://codex.wordpress.org/Function_Reference/the_content#Usage in single.php, replace <?php the_content(); ?> with: <?php if( strpos(get_the_content(), '<span id="more-') ) : ?> <div ...


2

put wp_enqueue_script() in your shortcode handler. add_shortcode('myshortcode', 'my_shortcode_handler'); function my_shortcode_handler($atts) { wp_enqueue_script('my-script', plugins_url('my-script.js', __FILE__), array('jquery'), '1.0', true); // actual shortcode handling here return "bacon flavored shortcode here"; } this definitely loads the ...


2

There's a whole bunch of plugins that do that. After some reading i decided to go with Syntax Highlighter Evolved.


2

When you register a plugin option page you get a hook from the registration function: $hook = add_menu_page( 'T5 Demo', // page title 'T5 Demo', // menu title 'manage_options', // capability 't5-demo', // menu slug 'my_render_page' // callback function ); Use this hook to enqueue the scripts and styles: ...


2

Try this code instead of your block: <?php $format = get_post_format(); if ( false === $format ) { ?> <img src="<?php bloginfo('template_url'); ?>/post-icons/standard.png" alt="standard" /> <?php } ?>


2

You can use the filter wp_admin_css_uri in the function of the same name which returns the uri of the admin css files. E.g.: function custom_modify_styles( $_file, $file ) { if( 'style' == $file ) // $file = css filename without extension $_file = 'my/new/path/to/style.css'; return $_file; } add_action( 'wp_admin_css_uri', ...


2

First of all Check If you disabled the visual editor from your profile page. [See the Screen Shot] You ned to uncheck the box - Visual Editor, the option is located in User's Edit Profile Page. UPDATE - 1 2 - You might have been disabled the Kitchen Sink, To enable it Click on small button available in visual editor (Right most button) icon or Press - ...


2

The CSS comes from wp-includes/css/buttons.css. Do not change this this file; it will be overridden during the next update. Create a separate plugin instead, or add some custom code to your theme’s functions.php, and hook into login_head: add_action( 'login_head', function() { ?> <style> .button { background: red !important; } ...


2

If your theme uses wp post class function post_classes($classes) { global $post; $customMetaVariable = get_post_meta( $post->ID, 'customMetaName', true ); if($customMetaVariable == 'desiredCustomMetaValue'){ $classes[] = 'cssClassName'; return $classes; } } add_filter('post_class', 'post_classes'); then in your ...


2

Your theme's body_class can be used to target specific pages: body.home /* front and subsequent pages */ body.paged /* any page *except* front page */


1

You’ll a need a real CSS parser like this one to filter the CSS. Regular expressions or simple string replacements are not safe enough.


1

just guessing now because lack of info, but it could be in your functions.php and maybe called by the function "wp_enqueue_style()" or try to search your theme folder for default.css and it should give you that file where it being included from. And no it is not a standard inclusion in WP.


1

Here is the idea add_filter('the_content', 'testfunc'); function custom_formatter($matches){ return "<strong>{$matches[0]}</strong>"; } function testfunc($content) { $pattern = "$\<p.*\>(.*)\<\/p\>$"; $content = preg_replace_callback($pattern, 'custom_formatter', $content); return $content; } However, you will need a ...


1

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 metabox has the id 'wpptabs_company_details', so the ...


1

I din't try it, but have a try yourself: Contact Form 7 uses something like this: <p>Your Name (required)<br /> [text* your-name] </p> Instead of using paragraph tag (<p>) use span (<span>), and some inline CSS, like: <span style="width: 48%; float: left; position: relative;">Your Name (required)<br /> ...


1

You could use the wp_head hook and inject your <style> tag directly into the <head>. Note: make sure you're firing the wp_head() function in your template (which you should be doing already). add_action('wp_head', 'random_background_image_wpse_83275'); function random_background_image_wpse_83275() { $images = array( '/path/to/image1.jpg', ...



Only top voted, non community-wiki answers of a minimum length are eligible