Today I’ve had a read about wordpress plugins, so far I understand that they are based on php. I have a css3 lightbox system, which basically applies several css rules to <ul class="lilbox"></ul>. I wan’t to make wordpress plugin for this, but I’m stuck. I’ve tried to look how to use php to apply certain classes, but it was unsuccessful. So could anyone explain the logic behind this? How would I create a wordpress plugin that applies certain css rules (from stylesheet) to every <ul class="lilbox"></ul> ?
Today I’ve had a read about wordpress plugins, so far I understand that they
Share
What you’re asking does not require a wordpress plugin, nor is that the purpose of a wordpress plugin.
You can achieve what you want to do with CSS alone.
The code above has, as you put it, “applie[d] certain css rules (from stylesheet) to every
<ul class="lilbox">“You could use PHP, for example, to add a
<ul class="lilbox">if certain conditions are met: maybe if there are images contained in a post you could place those inside of the lightbox, or only use the lightbox on a certain post type.But even in that case you haven’t created a plugin– that’s just something you put in your individual theme.
You would create a plugin if a certain function within your theme is something you want to easily reproduce (and let others reproduce) across multiple sites without having to re-write or adapt the code for each individual site.