Cannot access $wpdb, comes back NULL

As stated in the Comments, do not access a plugin file directly. Instead, use other means that incorporate the REST API or the included Ajax functionality in WordPress. To learn how to use Ajax in your Plugin, have a look here: Ajax in Plugins

WordPress meta_query >= &

Looks like I found the solution. I needed to use compare instead of operator in the meta_query so array( ‘key’ => ‘vacancy_small_salary’, ‘value’ => $vacancy_small_salary, ‘operator’ => ‘>=’, ‘type’ => ‘NUMERIC’ ), becomes array( ‘key’ => ‘vacancy_small_salary’, ‘value’ => $vacancy_small_salary, ‘compare’ => ‘>=’, ‘type’ => ‘NUMERIC’ ), and the same for the other query

Bootstrap Carousel HTML structure and funny output [closed]

You have a nested anchor tag. I have never seen that done before. You are wrote this with your code <a href=”#”><a href=”#”></a></div></div></a> I would think that is your problem. Why do you need this first anchor tag? ?php while ($postsSlider->have_posts()) : $postsSlider->the_post(); if ($first) { ?> <a class=”foto_link” href=”https://wordpress.stackexchange.com/questions/290742/<?php the_permalink(); ?>”>//should this be here … Read more

WordPress check if current taxonomy has child

There is solved: $taxonomy_name=”listing_category”; $queried_object = get_queried_object(); $term_id = $queried_object->term_id; $termchildren = get_terms( $taxonomy_name, array( ‘parent’ => $term_id, ‘hide_empty’ => false ) ); echo ‘<ul>’; foreach ( $termchildren as $child ) { echo ‘<li><a href=”‘ . get_term_link( $child, $taxonomy_name ) . ‘”>’ . $child->name . ‘</a></li>’; } echo ‘</ul>’;

Get uploaded image and attach it to the new post

You have to use the javascript FormData object to upload files via ajax. A simple tutorial is provided here. In PHP the file will be available via the globals $_FILES and $_POST. Additional to the tutorial the WordPress specific data “action” (and maybe “nonce”) have to be added to the formData object: formData.append(‘action’, ‘add_your_action_here’); // … Read more

Customize Menu | Styling LESS/SCSS code formats

I was able to get SASS syntax highlighting in a code textarea in Customizer with the following: add_action( ‘customize_register’, function( WP_Customize_Manager $wp_customize ) { $wp_customize->add_setting( ‘favorite_html’ ); $control = new WP_Customize_Code_Editor_Control( $wp_customize, ‘favorite_html’, array( ‘label’ => ‘SASS’, ‘code_type’ => ‘sass’, ‘settings’ => ‘favorite_html’, ‘section’ => ‘title_tagline’, ) ); $wp_customize->add_control( $control ); } ); via @westonruter … Read more