Site icon Hip-Hop Website Design and Development

Archive per 12 months of a customized submit getting the incorrect submit

Archive per 12 months of a customized submit getting the incorrect submit

I obtained the wp_get_the_archives() to record the years of my submit however regardless that the url is okay, the submit proven within the 12 months archive simply give the final submit relying on what number of submit I’ve per 12 months.

For instance, I’ve 3 submit for 2008, the archive of that 12 months will solely present me 3 posts however simply the final three (2 from 2021 and 1 from 2016). If I’ve 1 from 2016, the archive will present me one submit, however is simply the final one from 2021. And so forth… what did I do incorrect?

My features.php file


<?php 
perform recursos_ah6studio(){
    wp_enqueue_style('bootstrap', get_theme_file_uri('/css/bootstrap.min.css'));
    wp_enqueue_style('slick', get_theme_file_uri('/slick/slick.css'));
    wp_enqueue_style('slick-theme', get_theme_file_uri('/slick/slick-theme.css'));
    wp_enqueue_style('magnific-popup', get_theme_file_uri('/magnific-popup/magnific-popup.css'));
    wp_enqueue_style('font-awesome', get_theme_file_uri('/fontawesome-5.5/css/all.min.css'));
    wp_enqueue_style('estilo_ah6studio', get_stylesheet_uri());
    
    /*wp_enqueue_script('mainJS', get_theme_file_uri('/js/main_js.js'), NULL, '1.0', true); */
    wp_enqueue_script('jquery', get_theme_file_uri('/js/jquery-3.5.1.min.js'), NULL, '1.0', true);
    wp_enqueue_script('popper', get_theme_file_uri('/js/popper.min.js'), NULL, '1.0', true);
    wp_enqueue_script('boostrap', get_theme_file_uri('/js/bootstrap.min.js'), NULL, '1.0', true);
    wp_enqueue_script('slickJS', get_theme_file_uri('/slick/slick.min.js'), NULL, '1.0', true);
    wp_enqueue_script('magnific-popup', get_theme_file_uri('/magnific-popup/jquery.magnific-popup.min.js'), NULL, '1.0', true);
    wp_enqueue_script('easingJS', get_theme_file_uri('/js/easing.min.js'), NULL, '1.0', true);
    wp_enqueue_script('singlePageJS', get_theme_file_uri('/js/jquery.singlePageNav.min.js'), NULL, '1.0', true); 
    wp_enqueue_script('tool-tip', get_theme_file_uri('/js/tooltip.js'), NULL, '1.0', true);

} 
add_action('wp_enqueue_scripts', 'recursos_ah6studio');

perform mytheme_enqueue_front_page_scripts() {
    if( is_front_page() )
    {
        wp_enqueue_script('bkcground-random', get_theme_file_uri('/js/background_random.js'), NULL, '1.0', true);   
    }
}
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue_front_page_scripts' );

perform ourWidgetInit(){

register_sidebar( array (
'title' => 'Sidebar',
'id' => 'sidebar1',

));

register_sidebar( array (
    'title' => 'Desplegable',
    'id' => 'desplega1',
    'before_widget'=>'<div class="widget-item">',
    'after_widget'=> '</div>',
    'before_title'=>'<h6 class="category_title">',
    'after_title'=>'</h6>', 
    ));
}

add_action('widgets_init', 'ourWidgetInit');

//Añadir el thumbnail//
perform ah6studio_setup() {
    add_theme_support('post-thumbnails');
    add_theme_support('title-tag'); 
}
add_action('after_setup_theme','ah6studio_setup');

My plugin file ah6_postypes.php


<?php

perform ah6_papers() {
    register_post_type('papers', array(
        'has_archive'=> true,
        'public'=> true,
        'posts_per_page' => -1,
        'labels'=> array(
            'title'=>'Papers',
            'add_new'=> 'Agregar un Paper',
            'edit_item'=>'Editar un Paper',
            'all_items'=>'Todos los Papers',
            'singular_name'=>'Paper'
            
        ),
        'taxonomies' => array('temas'),
        'menu_icon'=>  'dashicons-media-text',
    ));
}

add_action('init', 'ah6_papers');


perform papers_categories() {
    //Taxonomía: TEMAS
    //Traducción para el backend

      $labels = array(
        'title' => _x( 'Temas', 'taxonomy common title' ),
        'singular_name' => _( 'Tema', 'taxonomy singular title' ),
        'search_items' =>  __( 'Buscar tema' ),
        'all_items' => __( 'Todos los temas' ),
        'parent_item' => __( 'Tema padre' ),
        'parent_item_colon' => __( 'Tema padre:' ),
        'edit_item' => __( 'Editar tema' ), 
        'update_item' => __( 'Actualizar tema' ),
        'add_new_item' => __( 'Añadir nuevo tema' ),
        'new_item_name' => __( 'Nombre del nuevo tema' ),
        'menu_name' => __( 'Temas' ),
      );    
     
    // Registrando la taxonomía
      register_taxonomy('temas',array('papers'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_in_rest' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'temas' ),
      ));

      //Taxonomía: TERRITORIOS
    //Traducción para el backend

    $labels = array(
        'title' => _x( 'Territorios', 'taxonomy common title' ),
        'singular_name' => _( 'Territorio', 'taxonomy singular title' ),
        'search_items' =>  __( 'Buscar territorio' ),
        'all_items' => __( 'Todos los territorios' ),
        'parent_item' => __( 'Territorio padre' ),
        'parent_item_colon' => __( 'Territorio padre:' ),
        'edit_item' => __( 'Editar territorio' ), 
        'update_item' => __( 'Actualizar territorio' ),
        'add_new_item' => __( 'Añadir nuevo territorio' ),
        'new_item_name' => __( 'Nombre del nuevo territorio' ),
        'menu_name' => __( 'Territorios' ),
      );    
     
    // Registrando la taxonomía
      register_taxonomy('territorios',array('papers'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'show_in_rest' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'territorios' ),
      ));
     
    }

    add_action( 'init', 'papers_categories', 0 );