Solved

php syntax

Posted on 2011-03-08
5
409 Views
Last Modified: 2012-05-11
I have this code:

<?      echo __('Oops, there is nothing in your cart.', 'wpsc') . " <a href='".get_option("product_list_url")."'>" . __('Please visit our shop', 'wpsc') . "</a>";
endif;
?>

I need to wrap the phrase like this:

<div style = "margin-top:75px"> echo __('Oops, there is nothing in your cart.', 'wpsc') . " <a href='".get_option("product_list_url")."'>" . __('Please visit our shop', 'wpsc') . "</a>" </div>


but it has to be in PHP - I am having difficulty writing this. Can anyone help out?
0
Comment
Question by:lvollmer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 11

Accepted Solution

by:
Bruce Smith earned 500 total points
ID: 35074754
Try the following code:  
echo('<div style = "margin-top:75px">');
echo __('Oops, there is nothing in your cart.', 'wpsc');
echo(' <a href="get_option(/'product_list_url/')">');
echo__('Please visit our shop', 'wpsc');
echo('</a></div>');

Open in new window

0
 

Author Closing Comment

by:lvollmer
ID: 35074783
thanks!
0
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 35074801
Sorry, line 3 should be this instead:
 
echo(' <a href="get_option(\'product_list_url\')">');

Open in new window

I got the slashes reversed.
0
 

Author Comment

by:lvollmer
ID: 35074838
yes i figured as much and made the change thank you!
0
 
LVL 11

Expert Comment

by:Bruce Smith
ID: 35074893
Cool, glad I could help!

Cheers
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question