Title: Modify shortcode
Last modified: October 23, 2023

---

# Modify shortcode

 *  Resolved [cdexswzaq](https://wordpress.org/support/users/cdexswzaq/)
 * (@cdexswzaq)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/modify-shortcode/)
 * Hi,
   I want to swop around the “title” and “designation” in my shortcode. So for
   example, the 4th picture would read “Hazel Bugler | Yoga”See the page linked 
   to. This is with theme “square 5”. Can you help?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fmodify-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [WPSpeedo](https://wordpress.org/support/users/wpspeedo/)
 * (@wpspeedo)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/modify-shortcode/#post-17146004)
 * Hey [@cdexswzaq](https://wordpress.org/support/users/cdexswzaq/),
 * I hope you are fine today!
 * To modify the output, you have to use a custom script. you can use the script
   in multiple ways, I prefer the **mu-plugins** method. Please follow the below
   steps:
 * 1: Create a **mu-plugins** folder inside the **wp-content** folder, if already
   not exists.
 * 2: Create a **PHP** file with a name you like inside the **mu-plugins** folder.
   For example **wps-team–modifications.php**
 * 3: Edit the **PHP** file you have just created, paste the below code, and save
   it.
 *     ```wp-block-code
       <?php
   
       /**
        * This function will modify the WPS Team plugin's member name.
        * It will add the designation if found at the end of the name with the '|' separator.
       */
       function wpspeedo_team__title_modify( $title, $post_id ) {
           if ( is_admin() ) return $title;
           if ( is_singular('wps-team-members') ) return $title;
           if ( get_post_type($post_id) !== 'wps-team-members' ) return $title;
   
           $designation = get_post_meta( $post_id, '_designation', true );
           if ( empty($designation) ) return $title;
   
           return $title . ' | ' . $designation;
       }
       add_filter( 'the_title', 'wpspeedo_team__title_modify', 10, 2 );
       ```
   
 * Let me know how it goes. If you have any issue let me ping here. have a good 
   day!
 * _Please do not forget to give us a rating._

Viewing 1 replies (of 1 total)

The topic ‘Modify shortcode’ is closed to new replies.

 * ![](https://ps.w.org/wps-team/assets/icon.svg?rev=2688678)
 * [Team Members Showcase](https://wordpress.org/plugins/wps-team/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wps-team/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wps-team/)
 * [Active Topics](https://wordpress.org/support/plugin/wps-team/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wps-team/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wps-team/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 2 participants
 * Last reply from: [WPSpeedo](https://wordpress.org/support/users/wpspeedo/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/modify-shortcode/#post-17146004)
 * Status: resolved