Different body image backgrounds on different pages, posts and categories

You need to add the classes for the corresponding cases. For pages/posts: $css = “body.page-id-**post_id** { background-image: url(‘$bg_image’); }”; For categories: $css = “body.category-**category_id** { background-image: url(‘$bg_image’); }”; You can retrieve post_id with $post->ID. For the category you need to check whether the page is_archive() and to append the corresponding ID or category name.

I can’t enqueue Suggest.js in frontend – not added

Provided you’ve confirmed that WP’s native ‘suggest’ script is actually being rendered on the page properly (ie. you’re using the correct template for home vs front-page), sometimes to avoid script conflicts on the page, you need to wrap your script in an anonymous function. So something like: <script> (function($) { $(“#my_input”).suggest(“<?php echo get_bloginfo(‘wpurl’); ?>/wp-admin/admin-ajax.php?action=ajax-tag-search&tax=my_taxonomy”, { … Read more

WordPress Jquery+scripts enqueue issue

The enqueue_parent_theme_style() and my_jquery_enqueue() functions do not have closing brackets. Does the above code run? Otherwise the code looks okay. Are running WordPress with WP_DEBUG set to true? https://codex.wordpress.org/Debugging_in_WordPress I use the following in my wp-config.php file: if ($_SERVER[‘REMOTE_ADDR’] == ‘123.456.789.123’) { define(‘WP_DEBUG’, true); define(‘WP_DEBUG_LOG’, true); define(‘WP_DEBUG_DISPLAY’, false); @ini_set(‘display_errors’, 0); } else { define(‘WP_DEBUG’, false); … Read more

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