Get parent theme version

In the WP_Theme class, the get method gives you a sanitized theme header. You cannot use it to extract a property. Actually you don’t need to, as you can access it directly like this: // get the parent object $parent = wp_get_theme()->parent(); // get parent version if (!empty($parent)) $parent_version = $parent->Version;

Notice that the wp_enqueue_style is not being called correctly!

The problem is that the wp_enqueue_style() call is inside of the category_collapse() member function of the CategoryCollapse() class, and the CategoryCollapse() class is being instantiated by a callback hooked into the plugins_loaded action hook. That means that the wp_enqueue_style() function is attempting to execute at the plugins_loaded hook, which fires before init, wp_enqueue_scripts, and admin_enqueue_scripts. … Read more

How Would You Enqueue A Google Web Font?

You should be able to just use http://fonts.googleapis.com/css?family=Rosario:400,700,400italic which is the “combined” URL given by Google when selecting multiple weights/styles of a font. You can then just register the font once. You don’t need to over-complicate the $handle either, something like google-fonts-rosario should do just fine as long as it is unique as mentioned in … Read more

The difference between calling wp_enqueue_scripts to load scripts and styles in custom theme

wp_enqueue_scripts Action Hook: WordPress provides various names (or place holders) that can be used to inject callback functions within WordPress core’s execution lifecycle. These are called action and filter hooks. wp_enqueue_scripts is a WordPress action hook. Note: It’s not wp_enqueue_script, it’s plural: wp_enqueue_scripts. With this hook, we add script or style on the correct time … Read more

How to add extra attribute to stylesheet link?

We can use style_loader_tag filter to filter the link that is being output. Here is the filter: $tag = apply_filters( ‘style_loader_tag’, “<link rel=”$rel” id=’$handle-css’ $title href=”https://wordpress.stackexchange.com/questions/231597/$href” type=”text/css” media=”$media” />\n”, $handle, $href, $media); Here the link $handle for which you want to add attribute is font-awesome so if the handle, so you can replace font-awesome-css with … Read more

Give priority to child theme stylesheet

Your child theme’s stylesheet will usually be loaded automatically. If it is not, you will need to enqueue it as well. Setting ‘parent-style’ as a dependency will ensure that the child theme stylesheet loads after it. /** * Enqueue theme styles (parent first, child second) * */ function wpse218610_theme_styles() { $parent_style=”parent-style”; wp_enqueue_style( $parent_style, get_template_directory_uri() . … Read more

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