New answers tagged

0

Thanks for your replies, but my code is still not working. At this point i really don't know what to do, i've been doing some tests and none seem to work. Reaching out with some additional code for context: The ajax call in the show.php file is the following right now: <script> $(document).ready(function(){ filter_data(); function filter_data() { ...


0

I am customizing the same theme. In my child theme functions file, I did the following to override the height: /* * Customize the header image parameters * See parent theme /inc/custom-header.php for reference */ function custom_parameters_wp_bootstrap_starter_custom_header_setup() { add_theme_support( 'custom-header', apply_filters( '...


0

That error messages means a failed admin nonce validation (check_admin_referer, which calls wp_nonce_ays). And you don't actually need an extra nonce here: these are extra fields to be added to existing forms that already have their own nonces, and the one you've added just clashes with them. (If you were adding a new form you would need these, yes.) So I ...


0

You need to add the ajax callback action on your plugin file or themes functions.php like as below: add_action( 'wp_ajax_fetch_data', 'fetch_data_callback' ); add_action( 'wp_ajax_nopriv_fetch_data', 'fetch_data_callback' ); then you need to put all the featch_data.php code inside the callback function 'fetch_data_callback' like as below: function ...


0

Another option can be overwriteing the default CSS rules with new ones in your theme style.css as shown below. This also allow to have different colors for different elements (if needed). /* ---------------- */ /* 3. 2020 Theme Primary colors /* ---------------- */ .primary-menu a, /*Arrows in Desktop*/ .primary-menu span.icon, /*Categories in Single Posts*/...


0

You can call a reusable block as you call to any post type: $args = array( 'post_type' => 'wp_block', ... OR get_page_by_title( 'Your Title', OBJECT, 'wp_block' );


0

To override a template in a child theme, e.g. archive-product.php, just add an archive-product.php or a more specific template file in the child theme. WordPress will preferentially load templates from child themes. No filters/hooks are needed to make it work.


0

It's a PHP error, not an Apache error. What's happening is that get_the_terms() returns an array of terms, or false if there are no terms or the post doesn't exist. You can fix this like this: $thiscategory = get_the_terms( $post->ID, $taxonomy_name ); if ( is_array( $thiscategory ) ) { // Only runs if $thiscategory is an array. $thiscategory = ...


2

I've made a page where the user can check the supported post formats, and the problem was that in case the user haven't checked any post format it returns false, and instead of returning an array that contains 'standard' like the following return ['standard'], I used only the keyword return to stop the function from running. Here is what I am talking about: ...


0

There's no mechanism for flagging an update from .org as being a security update or not. Updates are just updates, other than the version string there's little to no additional meta information. Change logs might mention it, but this is assuming the changelog is accurate, or present at all. Some plugins might follow semantic versioning, in which case you can ...


0

$galleries = $wpdb->get_results("SELECT meta_value FROM $wpdb->postmeta WHERE (meta_key = '_product_image_gallery' AND post_id = '". $post_id ."')"); $gal_images_ids = $galleries[0]->meta_value; foreach (explode(",", $gal_images_ids) as $gal_img_id) { $gal_images_url = ...


0

Usually scripts and styles are loaded with wp_enqueue_script or wp_enqueue_style in the theme's functions.php. That's the most common scenario. This function takes an $src parameter which is the absolute URL to the resource, and the best practice is to use get_stylesheet_directory_uri to retrieve the URL to the folder containing the script. This way, if the ...


0

What comes to my mind is that You should check Your wp-settings.php file, as it should include wp-includes/blocks.php file where "register_block_type_from_metadata" function is defined check that file for this line of code: require ABSPATH . WPINC . '/blocks.php'; if its not there, then Your wordpress installation could have been either hacked or ...


2

This is because WordPress.com is unique in this regard. If you purchase hosting and install WordPress on that host, you can then put a theme or plugins in the relevant folders, hundreds of themes, or even put a completely different application in WordPress' place if you chose to. This is what's called a self hosted install in the community. So you aren't ...


Top 50 recent answers are included