Solved

php syntax

Posted on 2011-03-08
5
404 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
  • 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

815 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now