Viewing 5 replies - 1 through 5 (of 5 total)
  • @regi.siti, what you have to do is to use the php code for calling a shortcode inside your template files. an example is

    <?php echo do_shortcode('Your shortcode goes in here '); ?>

    Your shortcode should look like this in the case of 1/5 + 4/5 column ,

    <h2>1/5 + 4/5</h2>
    [su_row]
      [kp_column size="1/5"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. [/kp_column]
      [kp_column size="4/5"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quam nibh, euismod eget nulla a, tempor scelerisque lorem. Proin dignissim arcu tristique fermentum ullamcorper. Integer lacinia scelerisque enim eu pretium. Nam elementum turpis orci, ac porttitor diam suscipit sit amet. [/kp_column]
    [/su_row]

    Hope this helped you.
    More on https://kamerpower.com/

    Thread Starter regi.siti

    (@regisiti)

    thanks for answer but if i use the code you gave me, the system gave a emply home page

    the code i used was:

    <?php echo do_shortcode('[su_row]
     [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. [/kp_column]
    [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. [/kp_column]
    [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. [/kp_column]
    [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. [/kp_column]
     [/su_row]'.); ?>

    @regi.siti You have to change all the kp_ prefixes to the prefix you have in your Shortcode => Setting. The default value is su_ but you have to check.

    <?php echo do_shortcode(' 
    
    [kp_row]
      [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quam nibh, euismod eget nulla a, tempor scelerisque lorem. [/kp_column]
      [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quam nibh, euismod eget nulla a, tempor scelerisque lorem. [/kp_column]
      [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quam nibh, euismod eget nulla a, tempor scelerisque lorem. [/kp_column]
      [kp_column size="1/4"] Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis quam nibh, euismod eget nulla a, tempor scelerisque lorem. [/kp_column]
    [/kp_row]
    
    '); ?>

    Looking at the last line of the code you gave above, there is a dot that is not suppose to be there. Anyways that’s not the case.
    Use this code exactly as it is but you will have to replace all the kp_ prefixes with your own prefix. To check your prefix, go to Shortcode => Setting you will find Shortcodes prefix

    Hope this helped You.
    More on https://kamerpower.com/

    Thread Starter regi.siti

    (@regisiti)

    Ok thanks a lot, this solved my issue — thanks

    You are welcome @regi.siti

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Short Code in PHP pages’ is closed to new replies.