Class::$template_dir_path=get_template_directory();
get_template_directory is a helper function to be used in themes. it returns the complete path of theme directory. advantage? require_once get_template_directory().’some-function.php’; got it?
get_template_directory is a helper function to be used in themes. it returns the complete path of theme directory. advantage? require_once get_template_directory().’some-function.php’; got it?
This is custom function the author uses to show how to use the_content filter. If you look at the line after the function add_filter(‘the_content’, ‘replace_hello’); this is saying to call the custom function replace_hello when encountering the the_content filter
what you could possibly do, is set up a post dedicated to the list, then on the post / page do an include to retrieve that list onto it. <?php $my_id = 7 <—this would be the post / page id you set up on for the list; $post_id_7 = get_post($my_id, ARRAY_A); $title = $post_id_7[‘post_content’]; … Read more
Don’t use the hook,instead just use wp_update_user when the form is filled out and you are ready to create the user: wp_update_user( array (‘ID’ => $user_id, ‘display_name’ => $posted[‘nickname’]) ) ;
In your header.php which you copied into your child theme, replace the logo request with this: If (is_front() || is_home) { //Your logo for the front page }Else { // Your other logo } If your home page is static use is_front. If your home page is blogs use is_home. I looked up your theme … Read more
Custom taxonomy check box now showing up
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
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
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
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.