Add category to body class

This late in the process you should be able to rely on context set up, even outside of loop. On top of my head something like this should work: $categories = wp_get_post_categories( get_the_ID(), [ ‘fields’ => ‘names’ ] );

how to Include json manifest file in wp plugin

Include this in you plugin add_action( ‘wp_head’, ‘inc_manifest_link’ ); // Creates the link tag function inc_manifest_link() { echo ‘<link rel=”manifest” href=”https://wordpress.stackexchange.com/manifest.json”>’; } what we are doing here is adding a hook to wp_head action.

WordPress Ajax Callback

It looks odd to me that your ajax_shortcode_function() registers and enqueues your ajax script. According to the codex, you should register/enqueue in functions.php. Additionally, if you only need the url to ajax-admin.php, the tutorial says you can use the global ajaxurl variable and therefore you don’t need to localize your script. The other thing that … Read more