slug; } if(isset($_GET['ano']) && isset($_GET['edicao'])){ $id_anoatual = $_GET['ano']; $anoatual = get_cat_name( $id_anoatual); $slug_anoatual = get_cat_slug($id_anoatual); $id_edicaoatual = $_GET['edicao']; $edicaoatual = get_cat_name( $id_edicaoatual); $slug_edicaoatual = get_cat_slug($id_edicaoatual); } else { /*ANO ATUAL*/ $args = array( 'type' => 'post', /* 'parent' => '2',*/ 'parent' => '3', 'orderby' => 'id', 'order' => 'asc', 'number' => 1 ); $categories = get_categories($args); foreach($categories as $category) { $anoatual = $category->name; $id_anoatual = $category->cat_ID; } /*ÚLTIMA EDIÇÃO DO ANO ATUAL*/ $args = array( 'type' => 'post', 'parent' => $id_anoatual, 'orderby' => 'id', 'order' => 'asc', 'number' => 1 ); $categories = get_categories($args); foreach($categories as $category) { $edicaoatual = $category->name; $id_edicaoatual = $category->cat_ID; $slug_edicaoatual = $category->slug; echo $edicaoatual; } } /* PRIMEIRO POST DA EDIÇÃO ATUAL */ $args = array( 'category' => $id_edicaoatual, 'posts_per_page' => 1, 'orderby' => 'id', 'order'=> 'desc' ); $postslist = get_posts( $args ); foreach ( $postslist as $post ) : $lastpostid = $post->ID; endforeach; /* IMAGEM CAPA */ $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $lastpostid ), "Full"); /* PERIODO DA PUBLICACAO */ $lastpost = get_post_meta( $lastpostid); $periodo = $lastpost['periodo'][0]; /* Restore original Post Data */ wp_reset_postdata(); ?>
have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $key = 'tipo'; $themeta = get_post_meta($post->ID, $key, TRUE); if ($themeta !=''){ $atual = true; } } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?> $id_edicaoatual .'', 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'tipo', 'value' => array('editorial','Editorial'), 'compare' => 'IN', ), ), ); // The Query $the_query = new WP_Query($args); // The Loop if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $autor = get_post_meta( get_the_ID(), 'autor', true ); $autor = str_replace('*', '', $autor); echo '' . get_the_title() . '
'; echo ''. $autor .''; } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?> $id_edicaoatual .'', 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'tipo', 'value' => array('dossiê', 'Dossiê', 'dossie', 'Dossie'), 'compare' => 'IN', ), ), ); // The Query $the_query = new WP_Query($args); // The Loop if ( $the_query->have_posts() ) { $count_dossie = $the_query->post_count; ?> 1) { ?> DOSSIÊ DOSSIÊ have_posts() ) { $the_query->the_post(); $autor = get_post_meta( get_the_ID(), 'autor', true ); $autor = str_replace('*', '', $autor); echo '' . get_the_title() . '
'; echo ''. $autor .''; echo ''; } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?> $id_edicaoatual .'', 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'tipo', 'value' => array('artigos', 'Artigos', 'artigo', 'Artigo'), 'compare' => 'IN', ), ), ); // The Query $the_query = new WP_Query($args); // The Loop if ( $the_query->have_posts() ) { $count_artigo = $the_query->post_count; ?> 1) { ?> ARTIGOS ARTIGO have_posts() ) { $the_query->the_post(); $autor = get_post_meta( get_the_ID(), 'autor', true ); $autor = str_replace('*', '', $autor); echo '' . get_the_title() . '
'; echo ''. $autor .''; echo ''; } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?> $id_edicaoatual .'', 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'tipo', 'value' => array('resenhas', 'Resenhas', 'resenha', 'Resenha'), 'compare' => 'IN', ), ), ); // The Query $the_query = new WP_Query($args); // The Loop if ( $the_query->have_posts() ) { $count_resenha = $the_query->post_count; ?> 1) { ?> RESENHAS RESENHA have_posts() ) { $the_query->the_post(); $autor = get_post_meta( get_the_ID(), 'autor', true ); $autor = str_replace('*', '', $autor); echo '' . get_the_title() . '
'; echo ''. $autor .''; echo ''; } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?> $id_edicaoatual .'', 'post_type' => 'post', 'meta_query' => array( array( 'key' => 'tipo', 'value' => array('entrevistas', 'entrevista', 'Entrevista', 'Entrevistas'), 'compare' => 'IN', ), ), ); // The Query $the_query = new WP_Query($args); // The Loop if ( $the_query->have_posts() ) { $count_entrevista = $the_query->post_count; ?> 1) { ?> ENTREVISTAS ENTREVISTA have_posts() ) { $the_query->the_post(); echo '' . get_the_title() . '
'; echo ''; } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?> have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $titulo = get_the_title(); $titulo = str_replace('*', '', $titulo); echo '' . $titulo . '
'; echo ''; } } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata(); ?>
NÚMEROS ANTERIORES 'post', /*'parent' => 2,*/ 'parent' => 3, 'orderby' => 'id', 'order' => 'desc', ); $categories = get_categories($arg_anos); foreach($categories as $category) { $id_ano = $category->cat_ID; $args_eds = array( 'type' => 'post', 'parent' => $id_ano, 'orderby' => 'name', 'order' => 'desc', 'number' => 3 ); $categories_ed = get_categories($args_eds); foreach($categories_ed as $category_ed) { $ed = $category_ed->name; $id_ed = $category_ed->cat_ID; array_push ($tudo, array('ano'=>$id_ano,'ed'=>$id_ed)); } /*fim do loop das edições*/ } /* fim do loop dos anos */?> $val) { if ($val['ed'] == $id) { return $key; } } return null; } $navkey = searchForId($id_edicaoatual, $tudo); //echo $navkey; /* preview é para a seta esquerda e next é para a seta esquerda*/ $previous_key = $navkey + 1; $previous_array = $tudo[$previous_key]; $next_key = $navkey -1; $next_array = $tudo[$next_key]; ?>