Checking if a post contains an html tag

You could try something like this if you are checking the content in the main loop. $content = get_the_content(); preg_match_all(‘/(<img .*?>)/’, $content, $img_tags); if (!empty($img_tags)) { // Post content contains images, do something! } // Check for links and do something if you have matches

Woocommerce custom attributes list help

If I understand your question correctly: <?php global $product; $sizes = $product->get_attribute( ‘size’ ); $sizes = explode(“, “,$sizes); ?> <?php if($sizes[0]!=”){ // if product sizes are defined ?> <ul class=”list-group”> <?php foreach($sizes as $size){ ?> <li class=”list-group-item”><?php echo $size; ?></li> <?php } ?> </ul> <?php } ?>

Bootstrap News: Image Modifciation

You would have to add the category via PHP on top of the image. First find the PHP template(s) where your page is rendered. This could be archive.php for the overview. For single posts this is usually single.php, or content-single-post.php. It depends on your theme. Then you find where the post thumbnail is being rendered, … Read more

Content going full width even though container is not

From a quick look, the contact form fields are centered, with a left and right column. This is on a laptop display; didn’t check other devices. But, the best way to diagnose this is with the Developer Tools. Right-click your form area, select “Inspect Element” (or whatever or F12), then poke around looking at the … Read more

current menu item hover not working?

I just checked your website and found some helpful CSS for your site. Find this line of CSS and change your color code, it will surely work. For menu hover and focus (‘Use this CSS in bedcentregrimsby.css’) .navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > li > a:hover { color: #a4cb9a; } Please feel … Read more

Changable favicon

If you have a modern theme, where you can upload a favicon with the theme customizer (rather than a hardcoded url in the header.php), you can simply use a filter. Take a look at the function get_site_icon. As you can see it returns the url of the image that you have uploaded using the customizer. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)