Create archives by author role

You may be able to abuse add_rewrite_endpoint for this purpose, depending on exactly what you want to do. Some examples: // add an endpoint // http:domain.com/role/ // http:domain.com/role/foo/ function wpa_add_role_endpoint(){ add_rewrite_endpoint( ‘role’, EP_ALL ); } add_action( ‘init’, ‘wpa_add_role_endpoint’ ); // check if a role parameter exists, like: // http:domain.com/role/foo/ function wpa_role_query( $query ){ if( $query->get(‘role’) … Read more

How to get alphabetic listing x other posts, based on first letter post?

For the solution you can use if statement as below put it in your sidebar, it will highlight the current post title. <ul> <?php $IDOutsideLoop = $post->ID; $args = array( ‘posts_per_page’ => -1, ‘orderby’=> ‘title’, ‘order’ => ‘ASC’ ); $myposts = get_posts( $args ); foreach($myposts as $post) : ?> <li <?php if(is_single() && $IDOutsideLoop == … Read more

dynamically filter by category via sub-menu

What you seem to be asking is relatively easy with a filter on pre_get_posts. function set_post_type_for_category_archive_wpse_101930($qry) { if ($qry->is_main_query() && $qry->is_category()) { $qry->set(‘post_type’, ‘news’); } } add_action(‘pre_get_posts’,’set_post_type_for_category_archive_wpse_101930′); That will hijack your entire category archive. That is why I asked if you “want to force your category archives to only show posts from the news post … Read more

One post on frontpage and an archive page

Alter the main query for the front/home page with is_front_page() and/or is_home(), like shown below: add_action(‘pre_get_posts’,’wpse104878_alter_main_query’); function wpse104878_alter_main_query($query){ if ( is_admin() || ! $query->is_main_query() ) { return; } if( $query->is_main_query() && is_front_page() || is_home() ){ $query->query_vars[‘posts_per_page’] = ‘1’; } } The archive page should work, if underscore starter theme has an template for it. You … Read more

Archives and category of authors

You can make specific pages (like landing pages) and call a specific header (or footer) template (i.e. header-authorPaul.php) by calling get_header ( “authorPaul” ); and then verifying that the author has post(s). Show the last one(s) if any. The same goes for archives.

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