WooCommerce Endpoints content

Dang it…must be blind….FOUND IT. The solution is, that since this is a custom hook, and most likely using JQuery, you place the end point action within the call. Instead of this: function mylistings_information_endpoint_content() { echo ‘THIS IS A TEST OF THE CONTENT’; } add_action( ‘woocommerce_account_information_endpoint’, ‘mylistings_information_endpoint_content’ ); It is this: function **mylistings**_information_endpoint_content() { echo … Read more

Change/Set Page Title and Meta Tags from Page Called within a Plugin

Attach to wp_head action hoook function that will display meta tag. Inside that function you can: add your own filter that will allow you to change the value, or change tag value depending of your query vars (sign1, sign2, …) or conditional tags. add_action( ‘wp_head’, ‘se344297_description_metatag_display’, 0 ); function se344297_description_metatag_display() { $site_descr = apply_filters( ‘description_tag_filter’, … Read more

Why aren’t some plugin styles loading when I load a template?

According to the WordPress Codex, using template_redirect to load a different template is discouraged and can cause certain code to not be executed, which of course can result in strange bugs. template_include is the more appropriate solution. It loads a template file but without the behavior mentioned above. add_action( ‘template_include’, function($original_template) { if (is_singular(‘business’)) { … Read more

Shortcode conflicts

When you define your shortcode, you might try one of a couple “if” statements to fix this issue, until you have time to create separate shortcodes. function cfgeo_shortcode( $atts, $content = “” ) { if (!isset($content) || stristr($content,’cfgeo’)!==FALSE){ // do short shortcode stuff here } else { // do ‘Container’ shortcode stuff here } return … Read more

Custom filter not working

I believe your the simple nature of your example may have led to a misunderstanding of the way appy_filters() would operate. There is a great article that really explains how to use add_filter() and apply_filters() well, using very readable examples. Basically, the problem appears to be that your code declares add_filter() AFTER you define it … Read more