WordPress Site Page Exists but Error 404

WordPress stores on the options table two urls for the site: siteurl and home. They should be the first two entries in the options table. Make sure that after migrating those two options match with your new domain. Duplicator should have taken care of it but just check to make sure.

Add Password Generator on password protected page

It is not possible to modify the post submit meta boxes with a filter. But you can do that with JavaScript. This script will generate 10-12 random alphanumeric string and put it in the password field (if it is empty) when you click the Password protected radio button. $(‘#visibility-radio-password’).click(function () { // If there is … Read more

Custom page with queries returns 404

WordPress rewrites standard wordpress urls from /category/post-name/ or whatever your selected permalink type is, into index.php?…. You are adding query vars to a link that is already getting rewritten into index.php?… and thus you are getting a 404. My advice to you would be to use something similar to an already asked question at Custom … Read more

How to select a specific page

From WordPress Codex Get Posts. <?php $the_slug = ‘my_slug’; $args = array( ‘name’ => $the_slug, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘numberposts’ => 1 ); $my_posts = get_posts($args); if( $my_posts ) : echo ‘ID on the first post found ‘ . $my_posts[0]->ID; endif; ?> That way you can get a post or page by its … Read more

All Pages visible on the Frontpage

In Twenty Seventeen you can only add 4 page in front-page section. see image below See Appearance=> Customize => Theme Options Update You can add extra section with filter twentyseventeen_front_page_sections add this code in functions.php function tws_custom_front_sections( $num_sections ) { return 5; //Change this number to change the number of the sections. } add_filter( ‘twentyseventeen_front_page_sections’, … Read more

the_content(); of custom post type treated as an array or object

single-book.php should not have a custom query in it. WordPress has already queried the correct post, so new WP_Query( $args ) is completely unnecessary. Your problem is that you’re missing the loop. At the bare minimum single-book.php should have: <?php while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_content(); ?> <?php endwhile; … Read more