Why does wp_customizer default values do not apply when theme is installed for the first time?

No, there is no automatic way to save all defaults, and for good reason. It avoids cluttering the database with unnecessary values, and allows themes to actually change their defaults down the line. Instead of trying to save all defaults, just change all your calls to get_theme_mod to include the default value as the 2nd … Read more

Adding a button to wp/aution plugin

You have added asterisk after the code. Here is the perfect code. add_action( ‘adifier_single_product_description’, ‘extra_button_on_product_page’, 9 ); function extra_button_on_product_page() { global $post, $product; if ( has_term( ‘accessories1-3d-design’, ‘product_cat’ ) ) { echo ‘<a class=”button” href=”www.test.com”>Extra Button</a>’; add_action( ‘adifier_3d-design_description’, ‘extra_button_on_product_category_description’, 9 ); function extra_button_on_product_category_description() { if ( is_product_category(‘accessories1’) ) { echo ‘<a class=”button” href=”www.test.com”>Extra Button</a>’; } … Read more

Post template not applying on theme (potentially rendering as Page template)

Fixed it! I have now created a single folder in my theme’s directory and put category specific templates in there. To enable this, I added this to the theme’s function file /* * Define a constant path to our single template folder */ define(SINGLE_PATH, TEMPLATEPATH . ‘/single’); /** * Filter the single_template with our custom … Read more