Reporting errors in a shortcode plugin

Take a look at admin notices. If you the cols parameter isn’t set use some code like this: function sample_admin_notice_fail() { ?> <div class=”notice notice-error is-dismissible”> <p><?php _e( ‘You forgot the cols parameter!’, ‘sample-text-domain’ ); ?></p> </div> <?php } add_action( ‘admin_notices’,’sample_admin_notice_fail’ ); to display this notice: on top of your admin page. You find some … Read more

What’s wrong with this piece of code? [closed]

This loop: while($listing->have_posts()): get_template_part( ‘partials/listing-cars/listing-list’, ‘loop’ ); endwhile; will never terminate, because $listing->have_posts() will never be false. You need $listing->the_post() to advance the loop to the next post in each iteration. Then, when the last post is reached, $listing->have_posts() will be false and the loop will end. while($listing->have_posts()): $listing->the_post(); get_template_part( ‘partials/listing-cars/listing-list’, ‘loop’ ); endwhile;

Custom Post Type Object – Undefined Variables

Looks like some minor confusion here and syntax issues. Bad: You’re including the $ sign when setting property values. // Set Variables $this->$post_type_name = strtolower( str_replace( ‘ ‘,’_’, $name) ); $this->$post_type_args = $args; $this->$post_type_lables = $labels; Good: Omit the $ once you’ve declared them. // Set Variables $this->post_type_name = strtolower( str_replace( ‘ ‘,’_’, $name) ); … Read more

How can I remove all traces of a theme?

The widget errors are the only ‘real’ errors. The header related errors are just caused by the error notices being output before the HTTP headers (including the one output in misc). Fixing that error would solve the others. The problem with the widgets is that they are written with out of date PHP (it doesn’t … Read more

pagination error in taxonomy: Warning: Division by zero

$per_page is $number_of_performers, which must be an incorrect value. PS: Also you can reduce your $sort_array defines with: $sort_array = array(); $alphas = range(‘A’, ‘Z’); foreach ($alphas as $lttr) $sort_array[$lttr] = __($lttr,’framework’); UPDATE furthering @tom-j-nowell point of $total_terms being the problem – your codes wp_count_terms()‘s second argument is supposed to be an array or a … Read more

How to trace an Error when it says nothing about any plugin?

To help debug, consider what was the most recent change to the website right before you noticed this error. Were there any new plugins installed, was WordPress upgraded, anything updated, modified or deleted in the theme and plugins? Normally it is recommended to make a clone of the site and test with that (or if … Read more