How to add description over forum list on bbpress root page

One possibility would be to hook into the bbp_template_before_forums_index like this: add_action( ‘bbp_template_before_forums_index’, ‘wpse118937_bbpress_forum_list_desc’); function wpse118937_bbpress_forum_list_desc() { //add your description code here } This will be displayed after the breadcrumbs and before the list. If you want more extensive customizations you can customize the template for that, but you shouldn’t do that in the plugin … Read more

Archive-custome_post.php template not working

Your pre_get_posts filter is incorrect. You are altering more queries than I think you think you are. The “main” query isn’t just the primary index. You are adding (or attempting to add) all of those post types to every page, basically,– the author archives, the categories, everything. Try this: add_action( ‘pre_get_posts’, ‘add_my_post_types_to_query’ ); function add_my_post_types_to_query( … Read more

Display custom widget value in header.php

The Codex is your friend. There’s a the_widget() function for that. <?php the_widget( ‘MY_Widget’, $instance, $args ); ?> Refer to the Codex entry for values for $instance and $args. $instance = array( ‘title’ => ‘Some Title here’, ‘name’ => ‘Some Name here’, ‘show_info’ => true ); $args = array( ‘before_widget’ => ”, // Your value … Read more

Conditional config WP_HOME/WP_SITEURL does not update bloginfo(‘template_url’)?

Found the solution… the problem was due to placement of the conditional statement in the wp-config.php file. It needed to be inserted before the require_once(ABSPATH . ‘wp-settings.php’); line near the bottom of the default config file, otherwise the constants are already defined and cannot be redefined. So final section of the wp-config.php file now looks … Read more

Rewrite rule shows 404 page

The index.php you see is not the template file. It is pointed to index.php file you see in the root of your WordPress installation. How does the pretty URL translate into a template file When a person goes to a URL on your site, the .htaccess redirects all requests, that don’t match an actual file, … Read more

Including template pages within another template?

The function get_page() has been deprecated, don’t use it anymore, use get_post() instead. get_page_by_title() returns an object by default, you can change this by altering the $output parameter, which you can use like you did. Although get_post() can take an object as $id parameter I personally prefer inputing the ID, but that actually shouldn’t matter. … Read more