Filtering with Attributes – how to display all non-queried products below query

To display products that do not match the filter (“No” products) below the filtered products (“Yes” products), you can modify your query logic to retrieve both filtered and unfiltered products in a single operation. Here’s how to implement it: Steps: Modify the Query Logic: Create two queries: one for filtered products (“Yes”) and another for … Read more

Hide or Show Read More Button by Content Area

This checks the number of characters and hide the button server-side in content.php: <?php $excerpt = get_the_excerpt(); $excerpt_length = strlen($excerpt); $excerpt_limit = 100; // Match the limit set in functions.php // only for debugging: var_dump($excerpt); var_dump($excerpt_length); ?> <div class=”news-main”> <?php the_excerpt(); ?> </div> <?php if ($excerpt_length >= $excerpt_limit) : ?> <div class=”news-read”> <a href=”<?php echo … Read more

How to display a function inside shortcode tags

I have modified the code… function myFunction() { $output=””; $entries = get_post_meta(get_the_ID(), ‘_kad_repeat_group’, true); if (is_countable($entries) && count($entries) > 0) : foreach ((array) $entries as $key => $entry) { $title = isset( $entry[‘_kad_title_ekstra’] ) ? esc_attr($entry[‘_kad_title_ekstra’]) : ”; $output .= ‘<h4>’.$title.'</h4>’; } endif; return $output; }

Output parent/child categories and posts in that parent/child hierarchy

You’re right that we need to handle parent-child relationships differently. Let me explain the approach and then show you the code changes needed. The key is to: First get only top-level categories (parent = 0) For each top-level category, check for child categories Display the hierarchy properly in the accordion <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js”></script> <link rel=”stylesheet” href=”https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.css”> … Read more

hide div if empty

currently, the structure of your code is like this : <div class=”text”> <div class=”banner-title”>post_title post_content</div> <?php if ($apmeta[‘ssylka’][0] != ”) {?> <a href=”…” class=”button white”>More</a> <?php }?> </div> </div> in order to not generate the div.text tag, you can move the condition to obtain that : <?php if ($apmeta[‘ssylka’][0] != ”) {?> <div class=”text”> <div … Read more

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