Second Level Menu

example: <?php //get top level page ID; $top = ( $post->post_parent ) ? array_pop(get_post_ancestors($post->ID)) : $post->ID; echo ‘<ul>’; wp_list_pages(‘title_li=&child_of=”.$top.”&depth=1’); echo ‘</ul>’; ?>

Why does this search.php not work?

I see at least two potential issues: You have if ( have_posts() ) : twice. Here: <?php if ( have_posts() ) : ?> <h1 class=”page-title”><?php printf( __( ‘Search Results for: %s’, ‘nothing’ ), ” . get_search_query() . ” ); ?></h1> And here: <ul id=”post-list”> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> The get_template_part() … Read more

How can I include custom category and tag base in template files?

We were able to get custom category and tag base names using: get_option(‘category_base’, ‘Categories’) get_option(‘tag_base’, ‘Tags’) We wrapped these functions in ucwords() in order to capitalize the base name and replaced “_” with “”: ucwords(str_replace(‘_’,’ ‘,get_option(‘category_base’, ‘Categories’)) ucwords(str_replace(‘_’,’ ‘,get_option(‘tag_base’, ‘Tags’)) Finally we wrapped all this with the code for localization and added the single cat/tag … Read more

Organize template parts and page templates in folders in regards of template hierarchy

Page templates are special case and since WP 3.4 can be put in subfolder natively. Other than that WP mostly expects flat file structure for templates. While template hierarchy is easily adjusted (see dynamic filter in get_query_template(), pretty much only thing needed)… From personal experience – overly extensive and nested directory structure for templates makes … Read more

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