Accidentally deleted the ‘home’ page as my front page, can someone help?
Go to Appearance > Customize > Static front page. “Your latest posts” should be selected there. If you didn’t mess with template of should fix your problem.
Go to Appearance > Customize > Static front page. “Your latest posts” should be selected there. If you didn’t mess with template of should fix your problem.
$args = array( ‘posts_per_page’ => 5, ‘cat’ => 77 // 77 – id category ); $query = new WP_Query( $args ); // loop if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); echo ‘<li>’; the_post_thumbnail(); echo ‘<a href=”‘.get_permalink().'”>’ . get_the_title() . ‘</a></li>’; } } else { // posts not fount echo ‘posts not … Read more
Add a counter to the query and vary the output depending upon what the count is. You’ll need to either directly edit the args to limit to 3 posts_per_page or use pre_get_posts to do it. pre get posts example (into your functions.php) function hwl_home_pagesize( $query ) { if ( is_home() ) { // Display only … Read more
There is a function called wp_get_referrer that you can use to see from which page a user is reaching the home page. Usage: if (is_home() && (wp_get_referrer() == ‘url/subscription/page’)) { … show page without widget } else { … show page with widget } Now, there is no built in way to use this condition … Read more
Typical menu structure with ‘Home’ item being a Custom Link and other menu items being pages: The ‘Home’ menu item must not point to a real page and should look like that: The ‘Home’ menu item stays the same, regardless of the choice you’ve made in Settings -> Reading -> Front page displays. Remove the … Read more
There are a lot of variables to this question so bear with me as I give you a solution that will get you close. assuming the field is called myimage and you’re returning the image url in the field control… open your home.php file in your child them (if you don’t have a child theme, … Read more
First check in your WordPress backend like 1) For Post: xyz.com.wp-admin/post-new.php post where if there is an option to select the template. If this option available then select the “Full Width Template” 2) For Page: xyz.com.wp-admin/wp-admin/post-new.php?post_type=page page where if there is an option to select the template. If this option available then select the “Full … Read more
As shown in the template hierarchy image from the documentation, you can name your .php file as front-page.phpor home.php. By default, WordPress sets your site’s home page to display your latest blog posts. This page is called the blog posts index. You can also set your blog posts to display on a separate static page. … Read more
it’s solved now. actually it’s simple problem. 😀 By previous developer there is file name index.html. The solution is delete/rename the file index.html. See printscreen
You can redirect users from home page to random page with this code (paste it to your functions.php) function my_homepage_redirect() { if ( is_home() || is_front_page() ){ $page = get_posts( [ ‘post_type’ => ‘post’, ‘posts_per_page’ => 1, ‘category’ => 1, // your category ID ‘orderby’ => ‘rand’, ‘fields’ => ‘ids’ ] ); if ( empty( … Read more