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

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

Give wp link pages it’s own template

In your single.php add this example code inside the loop: <?php global $page; if ($page == 1) {?> <div style=”color:red;”>This text should only appear on first page of the post!!!</div> <?php } ?> you can change the div with your thing that you wanted to display only on the first post page..

Query the database after get_header() has been included

Your question is vague: i’ll try to be as specific as possible. The basic rule is: if you need to modify the default query, use pre_get_post If you need to display another list of results than the one linked to your template url, use get_posts. I find this documentation to be quite useful http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/ Doc … Read more

Modify just ONE page based on a template

You should create a new page template based on your current page template. Without any example code it is hard to give you a specific example, but here’s an approach: Copy page.php to a new file and name it page-wide.php. The prefix page- is significant because it triggers WordPress’ template hierarchy. At the top of … Read more

Theme settings Page: Settings Api vs Update_Options

You are not wrong about conceptual limitation, but any development convention is inherently about constraints. Constraints are “bad”, but they are also often good and important. In this specific case it’s slightly soured by Settings API being especially nasty snowflake, which historically led people to reinvent this particular wheel a lot. However, your estimate of … Read more

Template_redirect for child custom post types

All sorted. For any one interested, I simply added in a function (into functions.php) that redirected to my new template dependent on the name of the post (you could also use the ID). add_filter(‘template_include’, ‘new_template’); function new_template($template){ global $post; if($post->post_name == ‘mortgage’){ $template = get_template_directory() . ‘/mortgage-template.php’; } return $template; }

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