Tag Info

New answers tagged

0

You can , strictly speaking, create a child theme with just a stylesheet. To achieve this, you will need to import the parent stylesheet into the child stylesheet using the @import method. This should however be avoided due to page load times for one. @import negatively impacts page load time. You should go and read this post on SO The correct way is to ...


0

Yes you will need to enqueue parent theme styles into child theme. Adding style.css in child theme will not automatically add parent theme's styles too. You can enqueue parent theme's styles like this. Create a new functions.php in child theme and paste this. function enqueue_child_theme_styles() { wp_enqueue_style( 'parent-style', ...


0

The styles you list look like the styles typically added to an image when you add a photo to a blog post. They wouldn't be things you would find by default in single.php. For example, if one is editing the post in text mode one might see an image coded like this: <img src="http://www.yoursite.com/wp-content/themes/twentyeleven/images/photo.jpg" ...


1

The best approach I found was to incorporate CSSTidy into my plugin. I took a page from JetPack which has a Custom CSS feature. JetPack's CSSTidy implementation is contained in the Jetpack_Safe_CSS class as function, filter_attr. I couldn't entirely figure out why JetPack was nesting the user entered CSS inside a 'div' element prior to parsing, but after ...


0

You should not need to alter the classes at all. A proper theme will be using the body_class() function will provide: Single Post Single post pages: single postid-{ID} Single blog post page: single-post Single custom post type page: single-{posttype} Those should be adequate selectors to allow you to get the effect you need without ...


0

Add a function to your functions.php file like this: function slider_scripts() { wp_enqueue_style( 'slider-java-script', get_template_directory_uri() . '/css/slider-java-script.css' ); //change the location to work for you } Then add slider_scripts() to the top of the template part ( partials/slider/slider-java-script.php )


1

This should work! function enqueue_random_style() { wp_enqueue_style( 'style-name', get_stylesheet_directory_uri() . '/inc/rcolor/' . mt_rand(1, 9)); } add_action( 'wp_enqueue_scripts', 'enqueue_random_style' );


0

Sometimes its when you haven't ended a piece of CSS off properly everything below it is ignored. Try moving the code up the CSS style sheet to see if this the issue. If it is then finding it can be a bit tricky..


1

Although Otto's answer is pretty good, I ended up with this in my child theme's functions.php function my_theme_styles() { global $wp_styles; $parentOriginalHandle = 'twentythirteen-style'; $parentNewHandle = 'parent-style'; // Deregister our style.css which was enqueued by the parent theme; we want // to control the versioning ourself. ...


6

You don't have to use @import. It's best not to, actually. Using an enqueued approach is probably better all around. Here's the relevant part of twentythirteen's code: function twentythirteen_scripts_styles() { ... // Loads our main stylesheet. wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' ); ... } ...


1

The default behavior for box-sizing is content-box. This is applied when you deselect the rules in Chrome. Have you tried applying box-sizing: content-box in your own CSS file instead of inherit? .ct-black-square { background-color: #88a0a9; box-sizing: content-box; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; } ...


0

To answer the last question: You may find the GitHub application for Windows helpful. (I use the GitHub application for Mac.) https://windows.github.com/


1

Delete DreamWeaver right now and do the following instead so that you can edit everything locally and see changes in real-time: 1) Install MAMP so you can run a server locally on your computer and then install Wordpress as you normally would but in a local computer folder 2) Download SublimeText as your code editor. 3) Download CodeKit (Mac-only) and us ...


0

Here is a great tutorial on how to add a colorpicker to your admin page. Regardless of how you are adding a colorbox or what plugin you are using, assuming you added it by adding a field in your options table (as provided in the link), you can use the color value anywhere in your template files with a call to get_option: $options = get_option( ...


1

This can be done by having the display: none; only on the .logged-in selector. Like this... .logged-in .hide-item-not-login { display: none; } You might want to change that .hide-item-not-login to a more accurate .hide-item-login or something to make it more clear for this changed use case. Though it makes no difference to the functionality of it.


1

Can't you change CSS rules? .hide-item-not-login{ display: block !important; } .logged-in .hide-item-not-login{ display: none !important; } EDIT To add login/logout menu item, you will need to add one more class to logout menu item. Let's say you added class .logout-link to logout menu item. Then you can add css like this. .hide-item-not-login{ ...



Top 50 recent answers are included