How to show posts of a specific category

Change $myposts = get_posts( ‘numberposts=6&offset=$debut’) to $myposts = get_posts( ‘numberposts=6&category_name=home-slider&offset=$debut’) OR $myposts = get_posts( ‘numberposts=6&category=1&offset=$debut’) replace 1 with your category ID Hope this helps

WordPress restriction to the whole website

This can be done as concisely as follows (in your theme functions.php or a plugin): function wpse_231970_lockdown() { if ( ! is_user_logged_in() ) { global $wp; /** * Redirect to login page with redirect back to current request. */ wp_redirect( wp_login_url( $wp->request ) ); exit; } } add_action( ‘template_redirect’, ‘wpse_231970_lockdown’ );

Onclick open posts displayed in slider in a popup [closed]

I am giving you an idea for this, you have to use jQuery for the popup and the below syntax will give you the current post data in a HTML popup. while ($the_query->have_posts()): $the_query->the_post(); echo ‘<div class=”non-popup”>’; echo ‘<div class=”card-title” id=”card-‘.get_the_title.'”>’.get_the_title().'</div>’; write you front end code + html (http://screenshotlink.ru/eff3d7431f4fbcd6a03ca5fcbbc41cdd.png) echo ‘</div>’; echo ‘<div class=”popup” style=”display:none;”>’; … Read more

Blog url disappears

Because this is how WP is set. You have set your permalinks structure to /%category%/%postname%/ so when you click on a post link, you will have that post /%category%/ and then /%postname%/. I guess you wished to have a structure like /blog-page/%category%/%postname%/. well just add this to your permalink settings /blog-page/%category%/%postname%/.

unable to get product by category only getting product added lastly

Try this code. <?php if(isset($_POST[‘step_03’])) { $que_01 = $_POST[‘que_01’]; $que_02 = $_POST[‘que_02’]; $que_03 = $_POST[‘que_03’]; $subcat = array(“$que_01”, “$que_02”, “$que_03”); $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, ‘product_tag’ => $que_01 ); } else { if(isset($_POST[‘cat’])) { $tags = $_POST[‘cat’]; } $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => -1, ‘product_category’ => $tags ); … Read more

How can i display portfolio images in WordPress?

First Try this to get the thumbnails, $size default is ‘thumbnail’: wp_get_attachment_image( $attachment_id, $size, $icon, $attr ); Second This code not tested with your code. Swap out the (taxonomy) for your tag. Check out this page for more information about the columns you are building in your category page. Manage $taxonomy id columns function my_custom_(taxonomy)_columns( … Read more