WordPress archives in header -necessary?

See this WordPress support page for an explanation of what the first line does. The second line you can remove and it will get rid of those archive entries from the header output HTML. For the SEO impact, search engines should be just fine as long as you have a site map for your posts.

Dynamic category name in query post

You shouldn’t use query_posts functions. You should create instance of WP_Query class In your theme folder create a new file called category-slug.php. You can copy the category.php file or archive.php file to create category-slug.php file. Then in the new category-slug.php file before the while loop you can write your query. $query = new WP_Query( ‘category_name=apple,pears’ … Read more

Add hour to archive link?

Permalinks or the pretty url of your posts be set under permalink in settings. there you can use %hour% or many other available tags in your url

Make tag archive display post are ordered by post format

You’re right. It isn’t a good structure. You are running three queries on the page– the two you are creating plus the main query that is being completely ignored (plus ancillary queries). You are also clobbering the main query halfway through the page load when you overwrite $wp_query, which can cause unexpected and unpredictable results … Read more

Is there a way to multiply archive loop results sequentially?

<?php $counter = 1; if(have_posts()) : while(have_posts()) : the_post(); ?> <?php if($counter == 1) : ?> <div class=”row clear” style=”margin-bottom:0px;”> <div class=”col-md-12 border-12″> <a class=”thumb” href=”https://wordpress.stackexchange.com/questions/202991/<?php the_permalink(); ?>” title=”<?php the_title_attribute(); ?>”><?php the_post_thumbnail(‘category-thumbnail’); ?></a> <div class=”blog-details-wrapper clear”> <h2 class=”title”> <a href=”https://wordpress.stackexchange.com/questions/202991/<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a> </h2> <span class=”date”><?php the_time(‘F j, Y’); ?> <?php … Read more

Make archive page show up in search results?

The issue is that an archive isn’t a post, it’s not something that can be shown in the loop. On your search results page, you’ll have to add some code to search categories for a similar name. You can accomplish this with the generic get_terms. Pass the searched term as the name__like argument (or maybe … Read more

Current author archive in navigation menu

Finally I figured it out and I am posting the solution for anyone who may be interested in such a workaround: function my_nav_menu_author_link( $menu ) { if( !is_user_logged_in() ){ return $menu; } else { $link = get_author_posts_url( get_current_user_id() ); $class = is_author() ? ‘ class=”current-menu-item”‘ : ”; $author_archive_link = ‘<li’ . $class . ‘>’ . … Read more

Echo taxonomy name – second level

You can use that code to retrieve the last taxonomy term in your taxonomy list: in your functions.php file create a custom function: function my_custom_function() { global $post; $terms = get_the_terms( $post->ID, ‘location’ ); if (!empty($terms)) { foreach($terms as $term) { if (!get_term_children($term->term_id, ‘location’)) { echo $term->name; } } } } When, inside your archive.php … Read more

Adding archive years to my menu

Hi Please follow below code do add dynamically year wise post under sub menu you want, I have added below code in functions.php add_filter( ‘wp_nav_menu_objects’, ‘ravs_add_menu_parent_class’ ); function ravs_add_menu_parent_class( $items ) { foreach ( $items as $item ) { //print_r($item);//print each menu item an get your parent menu item-id // get your menu item ID … Read more

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