WooCommerce shipping tax

This isn’t really a wordpress issue, but I’m going to answer it since I think the nature of the issue is not understanding that the code behind what is seen as an error in the outcome, is doing precisely what would make sense if the values entered were needed to create a total rather than … Read more

What is proper way to use the php if statement? [closed]

I assume you are trying to create a new template file linked to a WordPress page. Additionnal documentation : https://codex.wordpress.org/Theme_Development#Basic_Templates To make so, you would need to do something like this : <?php /* Template Name: My first template file */ get_header(); ?> <!– Main body –> <?php if (1<2) { echo “Add multiple lines … Read more

Post title not output correctly

From the WordPress SEO FAQ: … either enable “Force rewrite titles” on the SEO -> Titles settings page, or go into your header.php and change the title element to just this: <title><?php wp_title(”); ?></title> Did you try that?

Limit username to specific characters (A-Z and 0-9)

Using the regex posted by Moaz (and adding capitals), we will need to hook into the registration_errors filter: // Restrict username registration to alphanumerics add_filter(‘registration_errors’, ‘limit_username_alphanumerics’, 10, 3); function limit_username_alphanumerics ($errors, $name) { if ( ! preg_match(‘/^[A-Za-z0-9]{3,16}$/’, $name) ){ $errors->add( ‘user_name’, __(‘<strong>ERROR</strong>: Username can only contain alphanumerics (A-Z 0-9)’,’CCooper’) ); } return $errors; }

Force Jetpack to not use og:image tag for favicon / Site Icon [closed]

Probably through Jetpack, yet I’m not sure Looking at your site now I can say that those open graph tags are from Jetpack Plugin. If there is no image available in the post , Jetpack adds site-icon/favicon as the default one. We can control output of tags using filters jetpack_open_graph_tags jetpack_images_get_images jetpack_open_graph_image_default jetpack_enable_open_graph Remove only … Read more

Limited excerpt with readmore

You can use the default filter for the length of the_excerpt // Changing excerpt length function new_excerpt_length($length) { return 40; } add_filter(‘excerpt_length’, ‘new_excerpt_length’);

why is there an author.php

From the Codex: …when a viewer clicks on a link to a post author, by default he or she is taken to a page listing the posts from that particular author in chronological order, from newest posts at the top to oldest at the bottom. In other words, the author template is used to show … Read more

How to handle wp_query?

You’re not showing your entire code, so not all of these suggestions may be relevant: Use distinct, ideally descriptive, names for the variables that hold the different queries. Using the same variable, $my_query, can lead to unintended consequences. Be sure to close the first loop properly, with endwhile; endif;, before opening the second loop. Be … Read more