How to target first img in every wordpress post with CSS [closed]

Firstly i would say this is off-topic here as it purely relates to css/js, but let me try to give some pointers. Here you markup is : <article> <header></header> <div> …. <p><img class=”align-center” src=”https://wordpress.stackexchange.com/questions/225091/path/to/img1″></p> …. <p><img class=”align-center” src=”path/to/img2″></p> …. </div> </article> first-of-type means selecting the first child of the selector parent. In the above markup … 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

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

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

Load custom css after bootstrap

The above looks correct, however, you need to specify your script to enqueue after bootstrap by adding the bootstrap-min handle to the third, dependencies parameter. function register_css() { wp_register_style( ‘bootstrap-min’, get_template_directory_uri() . ‘/css/bootstrap.min.css’ ); wp_register_style( ‘custom-css’, get_template_directory_uri() . ‘/css/custom.min.css’, ‘bootstrap-min’ ); wp_enqueue_style( ‘bootstrap-min’ ); wp_enqueue_style( ‘custom-css’ ); } add_action( ‘wp_enqueue_scripts’, ‘register_css’ ); See wp_register_style for … Read more

customizing recent posts

Inside your post loop: <div class=”recent-post”> <div class=”thumbnail”> <?php if(has_post_thumbnail()) { the_post_thumbnail(); } else { // show a default image if no featured image is specified echo ‘<img src=”‘.get_bloginfo(“template_url”).’/images/img-default.png” />’; } ?> </div> <div class=”title”> <a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a> </div> </div> float the thumbnail div to the left and give the title div … Read more

TwentyTwelve versioning

How it’s NOT done in WordPress The following example is the opposite of how one should do it. Bad practice following: <style type=”text/css”> <!– /* … Definitions that are hard to override or get rid off are here … */ –> </style> This is another example how you should not do it: <link rel=”stylesheet” type=”text/css” … Read more

Deregister CSS style link ‘open-sans-css’

WP Core actually uses Open Sans font; it’s not a plugin. there is a plugin that removes it, but you can probably simply dequeue or deregister it. adding this to functions.php should work; if you want it removed from the backend as well, hook into the admin_print_styles action. function dequeue_opensans_css() { wp_dequeue_style( ‘open-sans’ ); } … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)