• Resolved do77

    (@do77)


    I am currently editing the profile-form.php to style the user’s profile. Above the profile it shows “profile updated” or error message in case you updated the profile.

    I added a div around the message to make it more prominent but now, even if I don’t update the profile, the box shows up.

    <div style="background: #ffffe0; border:1px solid #e6db55">
    <div style="padding:10px 10px 0px 10px">
    <?php $template->the_action_template_message( 'profile' ); ?>
    	<?php $template->the_errors(); ?>
    </div>
    </div>

    How can I make it that the box only shows up if there is actually a message to be displayed. Do I need to add some sort of if statement?

    I would appreciate any help!

    ThanKs!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Kathryn Presner

    (@zoonini)

    What I would do first is put things back the way they were. Then, check the source code in the browser, when the error message appears. See if there is an assigned ID or class for the error message. If there is, add some corresponding CSS for that ID or class to your stylesheet.

    For example, say the generated code says something like:

    <div id="profile-error">blah blah</div>

    In your CSS, add this:

    #profile-error {
      background: #ffffe0;
      border: 1px solid #e6db55;
      padding: 10px 10px 0 10px;
    }
    Thread Starter do77

    (@do77)

    good idea … i will try that! Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show alert box only if there is an alert’ is closed to new replies.