• taghaboy

    (@taghaboy)


    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

    (@taghaboy)

    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

    (@taghaboy)

    Any help pls

    Thread Starter taghaboy

    (@taghaboy)

    up

    csloisel

    (@csloisel)

    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

    (@taghaboy)

    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.