page 1 is not paged

do you mean you want a conditional for page 1 of all home queries which have more than one page as result? try to use $wp_query->max_num_pages; example: if (is_home() && $wp_query->max_num_pages > 1 && !is_paged()) echo ‘/page/1’; else echo “https://wordpress.stackexchange.com/”;

Homepage custom recent news

Assuming this is the default main query, see the example for pre_get_posts, which shows how to exclude a category from the main query: function wpa78465_exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘cat’, ‘-1,-1347’ ); // IDs of categories to exclude } } add_action( ‘pre_get_posts’, ‘wpa78465_exclude_category’ );

How to get or know the slug of home.php

Use is_home() for the home page (the list of newest blog posts), and is_front_page() for the front page (can be a static page too). if( is_home() ) { wp_nav_menu( array( ‘menu’ => ‘Main Nav Menu’, ‘container’ => ” ) ); }

How to redirect all page requests to a single “goodbye” homepage? [duplicate]

I found the answer with a little more searching. Sorry — Admins feel free to delete this question! The answer is here add_action( ‘template_redirect’, ‘wpse_76802_maintance_mode’ ); function wpse_76802_maintance_mode() { if ( ! is_page( 1618 ) ) { wp_redirect( home_url( ‘index.php?page_id=1618’ ) ); } } EXCEPT …. if there is a way to enhance this redirect … Read more

Random home page background images with caption text

First of all I don’t think that create a custom post type only for backgrounds is a right choose: backgrond are images and images already have their post type: attachment. If you have Worpress 3.5+ you can register a custom taxonomy for attachments, call it, e.g. ‘image_scope’ : register_taxonomy(‘image_scope’, ‘attachment’, $args ); for the $args … Read more

links to posts not working on homepage

If you want that the featured image is clickable replace: <?php the_post_thumbnail(); ?> with <a href=”https://wordpress.stackexchange.com/questions/108215/<?php the_permalink(); ?>” rel=”bookmark”><?php <?php the_post_thumbnail(); ?></a> For the title and date replace this: <h1 class=”entry-title”><?php the_title(); ?><br><small class=”time”><?php the_date(‘F j, Y’); ?></small></h1> whit this: <a href=”https://wordpress.stackexchange.com/questions/108215/<?php the_permalink(); ?>” rel=”bookmark”><h1 class=”entry-title”><?php the_title(); ?><br><small class=”time”><?php the_date(‘F j, Y’); ?></small></h1></a> Remove that … Read more

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