Support » Fixing WordPress » Using Functions with code that contains
4 years, 9 months ago
I’m sure it’s quite easy to do, but i am not so talented ;]
I have to make a function that outputs:
<div class="column-sidebar nomargin">
<?php do_action('shop_sidebar'); ?>
But when i make a function:
echo '<div class="column-sidebar nomargin"><?php do_action('shop_sidebar'); ?></div>';
I doesn’t work…
What do you mean
I(t) doesn’t work
the one line mixes strings and php;
try and rewrite it to:
echo '<div class="column-sidebar nomargin">'; do_action('shop_sidebar'); echo '</div>';
btw: that is alot of closing divs in the output of that function – are you sure that results in valid html code?
Yes, my theme contain a few divs 🙂 And that function is for wrapping a specific plugin – Jigoshop. My sidebar is in this particular place and i had to place it somehow there.
Thank You alchymyth! It works like a charm 😉
You can use the following code:
var url = “http:\\Google.com”
//it means url contains Google word.
indexOf returns the position of the word in the string. If not found, it will return -1