Hello, maybe someone can help me.
I’m using this code in my single.php:
get_template_part( ‘inc/related-videos’ );
Is it possible to hide this code when no content is available?
This is my inc/related-videos code:
I tried check “echo_ald_crp()” to see if it wasn’t empty:
$var = echo_ald_crp();
But it didn’t work as I expected, take a look to these screenshots:
Before the code change: https://prnt.sc/KsoW5PiBQ8tq
After the code change with content: https://prnt.sc/BQ4MGEFQ_8zD
After the code change without content: https://prnt.sc/wqMdDPUsv4sz
When having content, the code shouldn’t be hidden, only when is empty like in the last screenshot. Any idea how to fix the code to not hide when having content? 🙂
Thank you in advance!
- The topic ‘How to hide a section when having no content?’ is closed to new replies.