Title: Creating a Custom Shortcode
Last modified: July 17, 2018

---

# Creating a Custom Shortcode

 *  [kensoftwares](https://wordpress.org/support/users/kensoftwares/)
 * (@kensoftwares)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/creating-a-custom-shortcode-2/)
 * Accourding to thsi web site [https://www.sitepoint.com/wordpress-shortcodes-tutorial/](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
    -  This topic was modified 7 years, 11 months ago by [bcworkz](https://wordpress.org/support/users/bcworkz/).
      Reason: code fixed, title de-allcapped

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/creating-a-custom-shortcode-2/#post-10502416)
 * The shortcodes using [square brackets] are placed in post and page content. When
   the page is output, WP code searches content for known shortcode tags within 
   square brackets and replaces any such occurrences with the returned value of 
   the respective shortcode handler.
 * BTW – please don’t “SHOUT” (use all caps) in topic titles or anywhere else. It’s
   considered rude. I’m sure that was not your intention, that you were just unaware.
   Now you know.
 *  Thread Starter [kensoftwares](https://wordpress.org/support/users/kensoftwares/)
 * (@kensoftwares)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/creating-a-custom-shortcode-2/#post-10502457)
 * you are right , i was not aware. Thank you for your guidance and support.
 * You learn everyday. When you think you know it all , a big universe opens. Aristotle
   has rightly said;
 * “The more you know, the more you know you don’t know.”
 * ― Aristotle

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creating a Custom Shortcode’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [kensoftwares](https://wordpress.org/support/users/kensoftwares/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/creating-a-custom-shortcode-2/#post-10502457)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
