WordPress.org

Ready to get started?Download WordPress

Forums

Adding the Class in SMCF (4 posts)

  1. stylishcruising
    Member
    Posted 6 years ago #

    I am attempting to add this plugin, and have activated it. However, when I input the class, I get a syntax error. I'm putting it into sidebar.php, but am not having any success.

    I should just be able to input this, right?

    <?php if () : ?>
    <?php smcf() ?>
    <?php endif; ?>

    I'm putting it into the following place:

    <div id="right-sidebar">

    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar_2') ) : else : ?>

    <?php if () : ?>
    <?php smcf() ?>
    <?php endif; ?>

    <h3>Calendar</h3>
    <?php get_calendar(); ?>

    <div id="blogroll">
    <h3>Friends</h3>

      <?php get_links(-1, '
    • ', '
    • ', ' - '); ?>

      But I get the error:

      Parse error: syntax error, unexpected ')' in /home/stylishc/public_html/cruise/wp-content/themes/jd-sunset-3c-10/sidebar.php on line 27

      Please help!

    http://wordpress.org/extend/plugins/simplemodal-contact-form-smcf/

  2. Glenn Ansley
    Member
    Posted 6 years ago #

    I believe your getting the unexpected ) because you have nothing in your if statement.

    You have to put a condition in between the () following the word 'if'.

    You can see this syntax in your code elsewhere
    <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar_2') ) : else : ?>

    In the code above, "function_exists('dynamic_sidebar') && dynamic_sidebar('Sidebar_2')" is your conditional. There's no conditional in "if ()"

  3. stylishcruising
    Member
    Posted 6 years ago #

    Thank you...However, this now begs another question. What should the condition be? How do I update the code to list the "Contact Us" type of text, and trigger the plugin to work?

  4. Eric Martin
    Member
    Posted 6 years ago #

    Sorry about that...I guess I didn't put in the actual code!?!?

    Try:

    <?php if (function_exists('smcf')) : ?>
        <?php smcf(); ?>
    <?php endif; ?>

    If you still have issues, let me know.

Topic Closed

This topic has been closed to new replies.

About this Topic