Add meta-information to theme itself

It is not possible to extend the default headers used by WP_Theme: private static $file_headers = array( ‘Name’ => ‘Theme Name’, ‘ThemeURI’ => ‘Theme URI’, ‘Description’ => ‘Description’, ‘Author’ => ‘Author’, ‘AuthorURI’ => ‘Author URI’, ‘Version’ => ‘Version’, ‘Template’ => ‘Template’, ‘Status’ => ‘Status’, ‘Tags’ => ‘Tags’, ‘TextDomain’ => ‘Text Domain’, ‘DomainPath’ => ‘Domain Path’, … Read more

How to use the responsive images feature from WP 4.4 in your themes

Following our exchange in the comments I’ve reread your question and have a pretty straightforward answer: It looks like it’s working fine. You are worried about the sizes attribute in your second example, but it’s the srcset attribute that you should look at and it is showing all of your image sizes: <img src=”http://xxx.dev/wp-content/uploads/Delft_IMG_6275-e1453192498922.jpg” class=”attachment-full … Read more

WordPress Customize — Move “menus” options / field to another section

The customizer is divided into panels, then sections, then controls. You cannot move a panel inside another panel. However, you can move sections from one panel to another. In this case you can move the sections inside “Menus” to the “Header panel” like this: $wp_customize->get_section (‘AAA’)->panel=”BBB”; Where AAA is the slug of the section you … Read more

Identifying the priority of style.css so I can make a small CSS file load last

When you properly enqueue a file, an instance of the wp_styles (more on this) class is created. The priority of actions is ignored. So it doesn’t matter if you write anything like add_action (‘wp_enqueue_scripts’,’function_adding_main_style’,10); add_action (‘wp_enqueue_scripts’,’function_adding_small_style’,11); The reason is exactly the existence of the dependency system. WP first collects all enqueued style files and then … Read more

WordPress Customizer Typography: How to load just the unique Google Fonts?

This question is way too broad for a complete answer in a Q&A format, but here is roughly what I would do: Collect all system fonts in an array $sys_fonts Collect all Google fonts in an array $ggl_fonts Collect the complete info about Google fonts in a multidimensional array $ggl_fontinfo Merge $sys_fonts and $ggl_fonts in … Read more

How to fix the error “file_get_contents was found in the file functions.php”?

To Add External Atylesheet: Generally speaking, you should use the wp_enqueue_style() function to add external stylesheet to your theme. function wpse259600_add_style() { wp_enqueue_style( ‘theme_critical’, get_template_directory_uri() . ‘/css/critical.css’, array(), ‘1.0.0’ ); } add_action( ‘wp_enqueue_scripts’, ‘wpse259600_add_style’ ); To Add Internal Stylesheet: However, if (for whatever reason) you have to add internal stylesheet (i.e. printing the entire CSS … Read more

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