Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7497857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:15:02+00:00 2026-05-29T19:15:02+00:00

I have to say that I’m a newbie when it comes to php ,

  • 0

I have to say that I’m a newbie when it comes to php , but still this code seems to make sense. I’m trying to display a form in 2 different ways – one way if it’s on the page ‘cotatie-seo’ and another way if it’s on any other page in the site. The code I’ve used is:

<div style="position: relative; float: left;">
<p>Nume (required)<br />
    [text* your-name] </p>

<p>Adresă Email (required)<br />
    [email* your-email] </p>

<p>Adresă website (required)<br />
[text* Website]</p>
<?php if(is_page('cotatie-seo')) { ?>
</div>
<div style="position: relative; float: left;">
<p>[textarea* observatii 30x10 id:observatii] </p>
</div>
<?php } else { ?>
<p>[textarea* observatii 30x10 id:observatii] </p>
</div>
<?php } ?>
<p>[submit "Trimite"]</p>

If it’s not on the cotatie-seo page it displays the form properly, with the text area under the rest of the fields, but when it’s on the cotatie-seo page the text area displays both in the first div and in the second div (so it is displayed twice, both under the rest of the fields and next to them).

Thank you in advance for the help!

Thanks for the fast reply! The function is the regular WordPress is_page function:

function is_page( $page = '' ) {    global $wp_query;

    if ( ! isset( $wp_query ) ) {       _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );         return false;   }

    return $wp_query->is_page( $page ); }

I’m sorry but I can’t post images and I’m building the site on localhost, so I can’t provide a preview of the output.

Cheers!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:15:05+00:00Added an answer on May 29, 2026 at 7:15 pm

    One thing to try would be moving this bit:

    <p>[textarea* observatii 30x10 id:observatii] </p>
    </div>
    

    outside of the if-else (to just above the submit), and then dropping the else entirely since you repeat these lines in both if and else. Your snippet above would then be:

    <div style="position: relative; float: left;">
    <p>Nume (required)<br />
        [text* your-name] </p>
    
    <p>Adresă Email (required)<br />
        [email* your-email] </p>
    
    <p>Adresă website (required)<br />
    [text* Website]</p>
    <?php if(is_page('cotatie-seo')) { ?>
    </div>
    <div style="position: relative; float: left;">
    <?php } ?>
    <p>[textarea* observatii 30x10 id:observatii] </p>
    </div>
    <p>[submit "Trimite"]</p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

1st i have to say that i am not php professional and this is
Let say that we have the following query: SELECT DISTINCT COUNT(`users_id`) FROM `users_table`; this
I'm fairly new to Apache Camel, but have to say that I love it
I'm a newcomer to PDO and have to say that I like it so
First of all, I have to say that I'm going to talk about System.ComponentModel.Component
I have seen people say that it is bad form to use catch with
Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user
Let say that I have a website with some information that could be access
Lets say that I have a header user control in a master page, and
Lets say that you have a business object whose current state implies that there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.