How to replace default comments with custom HTML?

Note that with the following: add_filter (‘comments_template’, ‘fbcommentbox’, 100); we expect fbcommentbox() to return the path to the new comments template file. The default is the path of comments.php. If you create the fbcommentbox.php file in your theme, then you could try: add_filter( ‘comments_template’, ‘fbcommentbox’, 100); function fbcommentbox( $theme_template ) { // Path to our … Read more

Multiple API Endpoints (wp_remote_get)

You could write a function to pull both the responses. Then merge the results based on a successful result. This assumes the result for both calls is json data and should be converted to an array. I’m also using the same function calls you supplied so adjust the second where needed. function get_json_data_from_2apis($api1_data = array(), … Read more

term_exists() returning NULL on term that exists

The third argument for term_exists() is an integer, not an array. Parameters $term (integer|string) (required) The term to check Default: None $taxonomy (string) (optional) The taxonomy name to use Default: ” $parent (integer) (optional) $parent ID of parent term under which to confine the exists search Default: 0 Pass the correct arguments and it works. … Read more

enqueue script/style plungin development

You’ve given wp_enqueue_style a directory, but no file name. Have a look at https://developer.wordpress.org/reference/functions/wp_enqueue_style/: The first parameter of wp_enqueue_style is the name, or handle, of the stylesheet as referred to internally by WordPress (this should be a unique name for each stylesheet you enqueue) The second parameter is the src to the stylesheet – so … Read more

Internationalizing Plugin

You have to load text domain in your plugin: <?php function my_load_textdomain() { load_plugin_textdomain( ‘add-to-post-footer’, // text domain identifier false, // deprecated parameter plugin_basename(dirname( __FILE__ )) . ‘/languages’ ); // path to the languages directory } add_action(‘plugins_loaded’, ‘my_load_textdomain’);