How to save checkbox choice in wordpress

If I understood correctly, you are not able to save using update_post_meta. If this is you can try saving using jQuery using ajax, try this. //on change checkbox jQuery.ajax({ type: ‘POST’, url: “/wp-admin/admin-ajax.php?action=your_custom_function”, data:{ meta_id: ‘YOUR_META_ID’, //get user or post meta and set here meta_value: ‘YOUR_META_VALUE’ /the value you want to save in the meta … Read more

while loop to be continue in next section

What you are looking for is PHP’s modulo operator and adjust markup as necessary: <?php $i = 0; $did_hr = false; $post_args = array( ‘post_type’ => ‘Student Form’, ‘posts_per_page’ => 6 ); $post_query = new WP_Query( $post_args ); if ( $post_query->have_posts() ) : while ( $post_query->have_posts() ) : $post_query->the_post(); ?> <?php if ( $i % … Read more

get_header() on new page fatal error

Look into the theme template hierarchy. There is no “about.php” file and you should not link to any of the theme (PHP) files directly. Instead, you would create a theme file such as “page-about.php” and create its content in wp-admin as a Page with the slug “about,” and WordPress will process that Editor content within … Read more

Why does the first loop take arguments from the second loop?

Please try below code : <?php get_header(); ?> <main role=”main”> <section class=”container”> <div class=”row”> <div class=”col-lg-8″> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <h1 class=”text-center><?php the_title(); ?></h1> <?php endwhile; ?> <?php wp_reset_postdata(); ?> <?php endif; ?> <div class=”row”> <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args … Read more

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