wrap in a div or ID

Probably a very basic question - i have a plugin which creates a listings page. I want to target the link in here with css. What is the correct syntax to wrap this output in a div or ID please

if (isset($e_school_profile) && $e_school_profile !== ‘’)
{ $my_profile_button = ’ View our profile >>’;} // Profile button HTML

I am a bit confused by your code. You are opening and closing the span tag without doing anything.

Bearing in mind my confusion this is what I think you need if you want to wrap the whole thing in a div

[php]
if (isset($e_school_profile) && $e_school_profile !== ‘’)
{ $my_profile_button = ’

View our profile >>
’;} // Profile button HTML
[/php]

But if you want to apply your current class to the link then you need

[php]
if (isset($e_school_profile) && $e_school_profile !== ‘’)
{ $my_profile_button = ’ View our profile >>’;} // Profile button HTML
[/php]

If you want something else then please post back with a better description of what exactly you want.

Thanks for your help. This is code I inherited.

The span class is used to call and style the glyphicon (i’m using a bootstrap theme). If you look at ADT training here you will see what i mean - http://dev.begin-motorcycling.co.uk/motorcycle-training-schools/england/berkshire/#Newbury

I tried your code above (first one) and it breaks the styling on the icon. Is there a way to wrap a div around the span ?

Sorry i have very limited knowledge of PHP

You should be able to just do as you say - wrap it in a div.

[php]if (isset($e_school_profile) && $e_school_profile !== ‘’)
{ $my_profile_button = ’

View our profile >>
’;} // Profile button HTML[/php]

Thanks thats worked, i didnt have the syntax correct when i tried to hack it.

Sponsor our Newsletter | Privacy Policy | Terms of Service