Add shortcode with html content

This code snippet creates a shortcode with the html content . To call the shortcode you can call it on the WordPress editor by this [clientcat]


function ns_clientcat_function() {

 $variable = <<<XYZ

  <div style="width: 0px; height: 0px; overflow: hidden" itemscope="" itemtype="http://data-vocabulary.org/Review-aggregate">
  <span itemprop="itemreviewed">blabla</span>
  <span itemprop="description">Company rating</span>
  <span itemprop="summary">5 stars service</span>
  <span itemprop="description">5 stars service</span>
  <meta itemprop="worstRating" content="0">
  <span itemprop="rating">5</span>
  <span itemprop="votes">37</span>; <span itemprop="bestRating"></span>
  </div>

 XYZ;
 echo $variable;

}
add_shortcode( 'clientcat', 'ns_clientcat_function' );

 

ABOUT AUTHOR

Nuno

I am a Freelance Web Developer and WordPress Expert based in London with a wealth of website development and support experience. I am great at problem solving and developing quick solutions.

LEAVE A COMMENT

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • LET'S TALK!

    Fill in the form below to make an enquiry or find my contact details on my contact page.

  • This form collects your name and email address so that I can respond to the enquiry(ies) that you submit via this website. Please check my privacy policy for the full story on how I use, protect and manage your submitted data.