As you can see in my LI, I’m inlining the background but nothing is being echoed so I’m sure there’s something wrong with how I fetch the image.
Please help.
Do you get any error messages? Is the rest of the page rendered correctly or do you get an empty page? Could you post the rendered source code of the page?
<section id="menu">
<div class="wrapper">
<h2>Menu</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco.</p>
<ul class="category-list">
</ul>
</div>
</section>
So the rest of the page isn’t? Pls. turn on debugging in your config.php, to be able to debug code errors.
I guess not every page has an image? Then trying to get the url of an non-existing image will result in an error. Use an if-statement to check if an image exists before trying to echo the url to prevent such errors.
Unfortunately, this is not the case. To prevent that your site breaks if your users add a page without images, it is necessary that you always, always check if something exists before trying to do something with it.
Those images are set as background and not real thumbnails. The UX is it’s basically a link to its contents when clicked. So my question was, is it better for SEO purposes or other good reasons if I code it as a thumbnail/image instead of a background-image?
If there is no particular reason for using background images, I think it might be better to use image tags instead. This not only concerns SEO aspects but also questions of accessibility. But I’m not a SEO expert, and if the images are more for decorative purposes than conveying any meaning, it might not matter at all. From a perspective of reducing http requests, background images would only make sense if you use sprites, not single images.