PHP/jQuery – show content if div has one class, excerpt if it has another class?
-
Hi!
I built a theme from scratch and this is the first time coding a theme on my own so I don’t know so much concerning building a theme in WordPress yet so please forgive me if this is a stupid question! ??What I wanna do is: I have div elements on my front page that are styled as boxes in which the excerpt of a post is displayed.
My question now is how can I display the excerpt in a box that has a certain class (“small-box”) and the content if the box has another class (“big-box”)?I would be more than happy if you could help me with that question!
If you have got even more time to help me, maybe you could also help me with that:
I want the boxes on the front page to get bigger on click “read more” and in that big box I want to display the content whereas in the small box I want to display the excerpt.
What I thought I could do is toggle the class on click “read more” and though a conditional statement would display the excerpt in the div/box if this box has the class “small-box” etc.
Maybe there is a much better way to do that though and I haven’t quite succeded yet to get where I wanted…
Here is the theme I’m working on if you want to see what I mean: https://themes.inflamedpassion.com/Thanks in advance!
- The topic ‘PHP/jQuery – show content if div has one class, excerpt if it has another class?’ is closed to new replies.