Warning: join(): Invalid arguments passed in post-template.php

You did not returning the default class if you are not viewing the contact page. Try this code once if(! function_exists( ‘remove_hentry’ )) { function remove_hentry( $classes ) { $classes[] = customTheme_layout_class(); if( is_page(‘contact’) ) { $classes = array_diff( $classes, array( “hentry” ) ); } return $classes; } add_filter( ‘post_class’, ‘remove_hentry’ ); }

Redefine function arguments before rendering

Redefining a WordPress core function that might be used all over the place by the core, the theme or plugins isn’t a very good idea in my opinion. Because it might be used in those occasions expecting the default value to be what default is, which might lead to breaking things. So it is actually … Read more

wp_star_rating() – Adding a 5 star rating system to theme

Instead of redefining wp_star_rating() for the front end, you should be able to just use the built-in function. From the Codex page for wp_star_rating(): In order to use this function on the front end, your template must include the wp-admin/includes/template.php file and enqueue the appropriate dashicons CSS font information. (emphasis mine) A code sample is … Read more

Return child theme url

The correct function to use here is get_stylesheet_directory_uri(). Please feel free to read this useful post by @ChipBennet regarding this issue Your use of syntax is also wrong in your return statement as already pointed out. A variable is php, not html, therefore you don’t need the single quotes which are used to wrap html … Read more

Adding jQuery datepicker to Custom Post Type Metabox [closed]

To properly work I didn’t write my js file like you. My code will only stand for admin side not the frontend. In the js enqueue js file (date-picker.js): jQuery(document).ready(function(){ jQuery(‘.ads_datepicker’).datepicker({ dateFormat: ‘yy-mm-dd’ }); }); I enqueue my script like this add_action( ‘admin_enqueue_scripts’, array($this, ‘enqueue_date_picker’ ) ); public function enqueue_date_picker(){ wp_enqueue_script( ‘date-picker-js’, plugins_url(‘/js/date_picker.js’, __FILE__), array(‘jquery’, … Read more

Can’t Write Custom Widget Code In One ECHO

Technically your first example is also incorrect, but the problem is not apparent. You’re using template tags that themselves echo their content. For example, you can write simply: the_permalink(); without echo, and the permalink will be output. This is because that function echoes its value. To output the permalink within an echo or variable assignment … Read more