Title: Custom shortcodes for -php include-
Last modified: August 22, 2016

---

# Custom shortcodes for -php include-

 *  [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/)
 * Hi,
 * I’m newbie in the **Custom shortcodes** and i’d like to know how to change this
   php code to shortcode :
    `<?php include ('xyz.php');?>` to include my php code
   into the WYSIWYG editor.
 * Thanks

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

 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/#post-5763029)
 * I’m trying this but it dont work
 *     ```
       function custom_shortcode_include_xyz() {
       <?php include ('other.php');?>
       }
       add_shortcode( 'include xyz', 'custom_shortcode_include_xyz' );
       ```
   
 * Any help pls.
    Thanks
 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/#post-5763057)
 * Any help pls
 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/#post-5763217)
 * up
 *  [csloisel](https://wordpress.org/support/users/csloisel/)
 * (@csloisel)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/#post-5763218)
 * Try removing the space in the shortcode, I don’t think that is a valid character
   for a shortcode, maybe replace it with an underscore.
 * Also where are you putting this function? You shouldn’t need the php tags around
   the include because this should already be in a php file.
 * On top of that you need to make sure you are using the correct path for the included
   file.
 *  Thread Starter [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * (@taghaboy)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/#post-5763221)
 * I’d like to include it in the HTML editor “WYSIWYG editor”

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

The topic ‘Custom shortcodes for -php include-’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [taghaboy](https://wordpress.org/support/users/taghaboy/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/custom-shortcodes-for-php-include/#post-5763221)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
