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

No src and sizes attributes present on WordPress thumbnail images; the smallest image size is loaded irregardless of viewport size

WordPress Responsive Images Without Imagick No, you do not need Imagick to get WordPress responsive images (srcset and sizes) working. As of WordPress 4.4+, if your theme has post-thumbnails enabled and you are using core functions like the_post_thumbnail() or wp_get_attachment_image(), WordPress will automatically include srcset and sizes attributes (assuming multiple image sizes exist). The GD … Read more

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