How can I tell what category I’m in?
This should get you category object with ID, slug and rest of info: $wp_query->get_queried_object();
This should get you category object with ID, slug and rest of info: $wp_query->get_queried_object();
get_bloginfo( ‘version’ ) Other version globals can be found in wp-includes/version.php Also, it’s safer to use PHP’s version_compare().
style.css is the one and only required file in a child theme. It provides the information header by which WordPress recognizes the child theme, and it replaces the style.css of the parent. As with any WordPress theme, the information header must be at the top of the file, the only difference being that in a … Read more
You can create a basic theme options page using the WordPress settings api Here is a simple example that will create an input field for the user to enter a path to the custom logo. // Add a menu for our option page add_action(‘admin_menu’, ‘prefix_myplugin_add_page’); function prefix_myplugin_add_page() { add_options_page( ‘My Theme Options’, ‘Theme Name Options’, … Read more
If you’re going to add the nonce field to an HTML string, you have to specify that you don’t want it echoed. That’s the fourth parameter; see https://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/functions.php#L1952 $formDisplay .= wp_nonce_field( ‘contact-form’, ‘_wpnonce’, true, false );
Have you placed <?php wp_head(); ?> before the </head> tag and <?php wp_footer(); ?> before the </body> tag?
Just an FYI to other people who found this: I was able to achieve this using Grouped products instead of Variants. Simply add the main product (the Wine, in this case) as a ‘Grouped Product’. Then, add the 2 case sizes as simple product, and in the ‘Advanced’ tab, choose the Grouped product from the … Read more
Use shortcode: [theme-my-login show_title=0] or function: <?php theme_my_login( array( ‘default_action’ => ‘login’, ‘show_title’ => ‘0’) ); ?>
This will not work when submitting your theme to wordpress.org, and this is one of the first things the theme reviewer will tell you to fix (I’m not even sure if these styles will pass the Theme Check test). For every CSS style, fonts, additional scripts, etc., before sending your theme to wordpress.org for a … Read more
The function get_theme_file_uri returns http url like http://example.com/wp-content/theme/… The function get_theme_file_path returns file system url to file as /home/mysite/www/wp-content/theme/…