Creating a Custom Shortcode
-
Accourding to thsi web site https://www.sitepoint.com/wordpress-shortcodes-tutorial/;
I believe the code ;
the function// $attributes is an array of passed-in attributes. It would look like // [ 'align' => 'left' ]. // $content is a string of passed-in shortcode content. It would look like // 'This is the text that should go inside my pullquote'. function pqsc_process_shortcode( $attributes, $content = null ) { // Save each attribute's value to its own variable. // This creates a variable $align with a value of 'left'. extract( shortcode_atts( array( 'align' => '' ), $attributes ) ); // Return a string to display on the page return '<blockquote>' . $content . '</blockquote>'; }
is posted under functions.php.
But where exactly is ;
[pullquote_shortcode align=”left”]This is the text that should
go inside my pullquote[/pullquote_shortcode]Posted ?
Thank you in advance
Azhar
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Creating a Custom Shortcode’ is closed to new replies.