All pages show the same posts
-
Please somebody can help me i’m getting crazy
this is the website https://www.galanginternational.com/
i just copied the pagenavi code inside “display posts shortcode ” plug in .php
and it show in the other pages the same posts!!
code:// Create the shortcode add_shortcode( 'display-posts', 'be_display_posts_shortcode' ); function be_display_posts_shortcode( $atts ) { // Original Attributes, for filters $original_atts = $atts; // Pull in shortcode attributes and set defaults $atts = shortcode_atts( array( 'author' => '', 'category' => '', 'date_format' => '(n/j/Y)', 'id' => false, 'image_size' => false, 'include_content' => false, 'include_date' => false, 'include_excerpt' => false, 'offset' => 0, 'order' => 'DESC', 'orderby' => 'date', 'post_parent' => false, 'post_status' => 'publish', 'post_type' => 'post', 'posts_per_page' => '10', 'tag' => '', 'tax_operator' => 'IN', 'tax_term' => false, 'taxonomy' => false, 'wrapper' => 'ul', ), $atts ); $author = sanitize_text_field( $atts['author'] ); $category = sanitize_text_field( $atts['category'] ); $date_format = sanitize_text_field( $atts['date_format'] ); $id = $atts['id']; // Sanitized later as an array of integers $image_size = sanitize_key( $atts['image_size'] ); $include_content = (bool)$atts['include_content']; $include_date = (bool)$atts['include_date']; $include_excerpt = (bool)$atts['include_excerpt']; $offset = intval( $atts['offset'] ); $order = sanitize_key( $atts['order'] ); $orderby = sanitize_key( $atts['orderby'] ); $post_parent = $atts['post_parent']; // Validated later, after check for 'current' $post_status = $atts['post_status']; // Validated later as one of a few values $post_type = sanitize_text_field( $atts['post_type'] ); $posts_per_page = intval( $atts['posts_per_page'] ); $tag = sanitize_text_field( $atts['tag'] ); $tax_operator = $atts['tax_operator']; // Validated later as one of a few values $tax_term = sanitize_text_field( $atts['tax_term'] ); $taxonomy = sanitize_key( $atts['taxonomy'] ); $wrapper = sanitize_text_field( $atts['wrapper'] ); // Set up initial query for post $args = array( 'category_name' => $category, 'order' => $order, 'orderby' => $orderby, 'post_type' => explode( ',', $post_type ), 'posts_per_page' => $posts_per_page, 'tag' => $tag, 'paged' => $mypage );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘All pages show the same posts’ is closed to new replies.