Support » Plugin: Simple Author Box » How to insert code to php

  • Resolved Patryk

    (@patrykos360)


    Hi 🙂 I have a problem coding nature,
    How do I have to modify this code

    <?php if ( function_exists( ‘sabox_author_box’ ) ) echo sabox_author_box(); ?>

    to add to the already existing php code

    <?php

    Here is my post single code

    ?>

    i need to ad there this code but when i add then stops working my page 🙂

    i try to add

    if ( function_exists( ‘sabox_author_box’ ) ) echo sabox_author_box();

    but then the box does not appear

    https://wordpress.org/plugins/simple-author-box/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

    To add the author box function in your existing php code, you should enter the code without opening and closing php tags as follow:

    if ( function_exists( 'sabox_author_box' ) ) echo sabox_author_box();

    Then make sure you have activated the first plugin option: “Manually insert the Simple Author Box”

    Best

    Patryk

    (@patrykos360)

    I checked if the display outside the php code

    <?php if ( function_exists( ‘sabox_author_box’ ) ) echo sabox_author_box(); ?>

    and does not appear as if the code does not react

    i have on

    Manually insert the Simple Author Box

    when I set automatically insert then show up, but not where I wanted to
    is maybe some sort of another command to call up box?

    May be something wrong with the way you include this code or with the place where you include it. For example, the code may be wrapped by another conditional code, etc …

    Patryk

    (@patrykos360)

    My current code author box looks this:

    #post info
    if(!$disable_postinfo) {
    do_action(‘it_before_postinfo’, it_get_setting(‘ad_postinfo_before’), ‘before-postinfo’);
    echo it_get_post_info(get_the_ID());
    do_action(‘it_after_postinfo’, it_get_setting(‘ad_postinfo_after’), ‘after-postinfo’);
    }

    Is this something will you help? 🙂

    There is no SAB funtion in your code. I guess you should enter the SAB code without opening and closing php tags after the last curly brace “}
    I’m not sure since I do not know how’s the rest of your code.

    Look, I wanted to help but learning some basic conditional here is beyond the scope of this forum.

    Best

    Hi Tiguan,

    This code snippet you provided from the option page is wrong:
    <?php if ( function_exists( ‘sabox_author_box’ ) ) echo sabox_author_box(); ?>

    And this is the correct one:
    <?php if ( function_exists( ‘wpsabox_author_box’ ) ){ echo wpsabox_author_box(); }?>

    Hi Patryk, try this: <?php if ( function_exists( ‘wpsabox_author_box’ ) ){ echo wpsabox_author_box(); }?>

    Thanks,
    AB

    Hi Patryk,
    I apologise for the issue and misunderstanding. Fixed!
    Best

    Hi @mazter3000,
    Thanks for the bug report! Fixed!
    Best.

    Patryk

    (@patrykos360)

    It works now thanks!

    Now i can rate the plugin 🙂

    Thanks for your rating!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to insert code to php’ is closed to new replies.