Adding an IF ELSE to a function

You can write this code like below- <?php $element = get_queried_object_id(); if (!empty($element)) { $terms = get_terms([ ‘taxonomy’ => $element->taxonomy, ‘parent’ => $element, ]); echo ‘<div style=”height: 200px; text-transform: uppercase; border:1px solid #666666; padding:10px; overflow-y: scroll;”> <div class=”breaker-small”>Refine Search</div>’; foreach ($terms as $term) { echo ‘<p class=”filters”><a href=”‘ . get_term_link($term) . ‘”>’ . $term->name . … Read more

What changes are needed for this conditional code to work on deeper levels?

looks like you were close. Can you try reversing your post parent statement? ‘2704’ == $post->post_parent should be ($post->post_parent == ‘2704’) Notice i put it in parentheses as well. so your code would be: <li<?php if ( is_page(‘channels’) || ($post->post_parent == ‘2704’) ) { echo ” class=\”current\””; } // the page is ‘channels’, or the … Read more

Conditions for admin get_current_screen action parent_file edit.php?post_type=page

You can use get_current_screen() to get details about the current screen. We want to hook on or after load-edit.php because get_current_screen() is defined just prior to this hook. By hooking into load-edit.php, we guarantee that this code will only fire on the edit.php page. Then we check the current screen to see if the post … Read more

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