Add a Second Menu to a theme that only support 1 menu

Adding custom menu position to your wordpress theme is fairly simple. This is usually done this way: 1. Announcing the desired menu positions (in function.php): add_action( ‘init’, ‘register_my_menus’ ); function register_my_menus() { register_nav_menus( array( ‘first-menu’ => __( ‘First Menu’ ), ‘second-menu’ => __( ‘Second Menu’ ), ‘third-menu’ => __( ‘Third Menu’ ) ) ); } … Read more

Custom Post Type Taxonomies -Posts not showing in Category or Tag pages

You were close with the code you posted in your comment. The issue is that you only tested for is_main_query, which will limit every query on your site to that single post type. function wpa82763_custom_type_in_categories( $query ) { if ( $query->is_main_query() && ( $query->is_category() || $query->is_tag() ) ) { $query->set( ‘post_type’, array( ‘post’, ‘resource’ ) … Read more

Custom Post Templates

I think this approach will work. 1.create template for single post like singlepost.php( default single post template),singlepost-99.php,singlepost-101.php. 2.now put just this code in single.php <?php global $post; get_template_part(‘singlepost’,$post->ID); ?> what this code does check for single post template for current post by post id if not found call singlepost.php. Important Link: get_template_part()

Theme development question regarding layouts

Your consistent/common areas are: Header (Including nav) Footer Sidebar So you can easily make them accordingly to: header.php – get_header(); footer.php – get_footer(); sidebar.php – get_sidebar(); And the right content area, as it is inconsistent, so it can be separated into a different page as: content.php (general template) content-double.php (template 1) content-page.php (template 2) etc. … Read more

post edit button on front end

The function is edit_post_link() (see Codex or source). In TwentyEleven it used as follows in content.php edit_post_link( __( ‘Edit’, ‘twentyeleven’ ), ‘<span class=”edit-link”>’, ‘</span>’ ); You can simply use the function as indicated above (or in the Codex) in a custom template, but it must be used inside the loop. There’s no need to perform … Read more

Loop through pages with specific template

WordPress saves page templates that is assigned to a specific page in the db in the wp_postmeta table. These are saved as follows: ‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => ‘NAME_ OF_TEMPLATE’ With this in mind, you can loop through pages which shares a specific page template, using get_pages (You can also make use of WP_Query) Example: … Read more

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