Help with is_page() and calling css for specific pages in a Child Theme

The first parameter of wp_enqueue_style and wp_register_style is used to register the stylesheet for later use. So, you can register it early and later call it just specifying it’s first parameter. In this case you are registering and enqueueing the stylesheet td-theme-child, which file is style.css. After that, if the conditional passes, you are registering … Read more

Using Switch Statement to Change Image According to Last Digit of Topic ID

I would try something like this: function bg_image_topic_titlearea() { if ( ! function_exists( ‘bbp_get_topic_id’ ) ) { return false; } if ( ! $letztezifferimgs = bbp_get_topic_id() ) { return false; } $letztezifferimgs = substr( $letztezifferimgs, – 1 ); // switch … return true; } I would recommend checking to make sure the function call (bbp_get_topic_id();) … Read more

Why does Featured Images not load in the backed?

In your code excerpt you have a function to add theme support for post thumbnails but you don’t include a line where you actually run it. Can you confirm that you are also executing wpb_theme_setup() as well as defining it? If it’s the only thing in the function, you could just call add_theme_support( ‘post-thumbnails’ ); … Read more

Display ads on post in a particular category

You can not use this code twice, since it’s declaring a function, and declaring a function twice with the same name will trigger a fatal error. If you want to extend the function, you can use it this way: if(!(in_category(‘7’) OR in_category(‘8’) OR in_category(‘9’))) return $content; This will show the ads on these 3 categories.