New answers tagged

0

Here is an other interesting article that makes a decent job of listing all the available css classes/html markup one can use in styling an admin page. The articles is a little outdated in that it show styling results from older version of WordPress, so its likely that additional classes have been added since. Another useful resources are the WordPress ...


0

Normally the quickest way is to go to Appearance > Themes > Customise (on your theme). This allows you to insert custom CSS. I usually prefer to create a child theme and either override the header.php file by copying it into the child theme in the same folder location. Or enqueue the stylesheet using functions.php in your child theme. The child theme ...


0

// add body class for that. add_filter( 'body_class', 'custom_class' ); function custom_class( $classes ) { if ( is_single() && 'post' == get_post_type() ) { $classes[] = 'article-page'; } else{ if(!is_page('library')) $classes[] = 'home'; } if(is_page('contact-page')){ $classes[] = 'contact-page'; } if(...


0

You want to add different CSS class on different page. You can do it by checking it by page or page id. It's going to bit long work for you. However, you can do it two way. (May be more ways are there but I suggest you these two) For both you should have added following code into active theme's header file where you render body tag <body <?php ...


1

In your functions.php: function my_body_class($classes) { if(is_page()){ global $page; $title = get_the_title( $page ); $classes[] = $title; } return $classes; } add_filter('body_class', 'my_body_class'); That will add the page title as a class to each page.


2

Couple of options for you. Option 1: Use the body_class() function to add the page slug to the class. function add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_name; } return $classes; } add_filter( 'body_class', 'add_slug_body_class' ); Then whatever the url is, say "yourdomainpage.com/...


0

You are resizing your logo in your css, giving that flash of unstyled content on load/reload. It's original size is 150x150px. You have at least two options: Change it for a smaller version (75x75px), avoiding the jarring resize. Alter the css to make it display:none (like your other logos) and make it fade in with javascript. Give these a try.


3

Mostly no, but you shouldn't do that anyway. The exception, is if your user has the unfiltered_html capability, which is a dangerous power to have. Users that have this are admins on a single site install, or a super admin on a multisite install. But, there are major security downside to putting script and style tags directly into articles. For CSS, it's ...


0

If you are a theme developer, you might want to force reload of your assets when you push new version. So versioning of a theme is done in style.css /* Theme Name: Your Theme Name Version: 1.0.2 */ At the top of your functions.php: $theme = wp_get_theme(); define('THEME_VERSION', $theme->Version); //gets version written in your style.css ...


0

This is more of an html question but, you'd have to write a theme, or at least a child theme. An absolutely terrible way to do this would be with tables ... but, that'd probably be the easiest way. Something more like this would be sufficient: <div class="row">title 1, title 2</div> <div class="row">image 1, image 2</div>


0

In your functions.php file (you're using a custom child theme, right?) change/add the version parameter to wp_get_theme()->get( 'Version' ) this will pull the version number from your theme's style.css file. https://developer.wordpress.org/reference/functions/wp_enqueue_style/ Setting this parameter to false will use the WordPress version. ...


0

It's using 5.2.3 because no version was specified when style.css was enqueued/registered. So it fell back to the version of WordPress. If you pass in a version when calling wp_enqueue_style, it will use that value instead


-1

Change the version number in your style.css file. Edit: I misunderstood. I think that's the WordPress version.


0

You're using the incorrect hook. The only hook is wp_enqueue_scripts (plural). You use wp_enqueue_style() and wp_register_script() etc. on that hook, but the hook is always the same. So this: add_action('wp_enqueue_script' , array( $this, 'initBootstrap' )); add_action('wp_enqueue_style' , array( $this, 'initBootstrap' )); add_action('wp_register_script' , ...


0

Instead of setting up margin/padding. Try setting up max-width of full-container a <div> next to site-main: body.responsive.layout-full #page-wrapper .full-container { max-width: 95%; margin-left: auto; margin-right: auto; } You can change max-width to your desired percentage value.


0

For some reason, there's a display none on the :before of your button. The following should fix this. .woocommerce-page ul.products li.product .button.add_to_cart_button:before, .woocommerce ul.products li.product .add_to_cart_button:before { display: block; }


0

You didn't mention the library you're using to generate this meta, but i guess it's the cmb2 library, if it's so then you should change your array params as follow : array( 'label' => esc_html__( 'Property Lot Size', 'zoacres' ), 'desc' => esc_html__( 'Enter lot size of property by number. Do not use any special characters like comma, dot ...


0

Can you see the changes in an incognito window on mobile? If so, then its most likely a mobile cache issue and a common way to fix that is by adding a version number to your css file i.e. wp_enqueue_style( 'my-main-styles', get_stylesheet_directory_uri() . '/style' . $suffix . '.css', array(), $version_number_here ); If breaking the cache that way doesn't ...


1

what do you want to change exactly? like the first picture you shared or something else? if you want to edit text itself you need to edit a tag inside the menu-ticket class like this .menu-ticket a {font-size:40px;}


2

You can add CSS to the admin area of WordPress using the [admin_head][1] hook add_action('admin_head', 'my_custom_admin_styles'); function my_custom_admin_styles() { echo '<style> #qt_content_center { color: red; } </style>'; } Note: Alternatively, you could add a stylesheet using the same function. Edit: Adding custom ...


0

This maybe old. But I need to support someone who may looking for a help. I had the same problem and I checked my plugins. There was "w3 total cache" plugin that speedsup loading. That is server side cache plugin so I disabled it. The css changes are visible again realtime. There are lot of loading booster plugins. So check your plugin list and disable them ...


0

Login to wordpress then Appearance->Theme Editor Add your CSS to style.css file and place your Javascript code somewhere in footer.php file with $ replaced with jQuery and on page edit option place css classes where you want to give css to


Top 50 recent answers are included