Wordpress Hack #2: How To Create A Master Archive Index Page Wordpress Hack # 2: Cómo crear un archivo maestro página de índice
450 views - 450 opiniones -Posted in: Publicado en:
450 views 450 opiniones
Please note: This page was originally written in English. Atención: Esta página fue originalmente escrito en Inglés.
The original post can be viewed El post original se puede ver here aquí .
Please note: This page was originally written in English.
The text has been translated using an online service such as Google or Babelfish.
The original post can be viewed here.
In your Wordpress blog do you have a sortable clean and easy way for visitors to access your previous posts? En su blog Wordpress, ¿tienes un sortable limpia y sencilla para los visitantes a acceder a sus puestos anteriores? Other than the month based archive link in your sidebar, you may not have an archive index at all! Otros que el mes de archivo basado enlace en la columna lateral, puede que no tenga un archivo índice a todos! It’s time you hacked your own Master Archive Index Page! Es hora que cortó su propio Maestro página Índice de archivos!
This is Wordpress Hack #2 in our 30 “Hack-a-Thon”! Se trata de Wordpress Hack # 2 en nuestro 30 "Hack-a-Thon"! That’s right, I’m going to give you one Así es, voy a darle un Wordpress hack per day for 30 days Wordpress hack por día durante 30 días , and at the end of that time you will have pimped out your blog like you never would have believed possible! , Y al final de ese tiempo usted tendrá pimped su blog como si nunca hubiera creído posible! Be sure to signup for the RSS feed or subscribe by email at the top of the page. Asegúrese de registro para la alimentación de RSS o suscribirse por correo electrónico en la parte superior de la página.
Out of the box the default Archives for Wordpress aren’t very sexy. Fuera de la caja el valor por defecto para los archivos de Wordpress no son muy sexy. In fact, as I’ve mentioned in previous posts the word thing about Wordpress (to me) is the fact that the content seems hard to navigate, hard to get to, and downright self-defeating at times. De hecho, como he mencionado en anteriores puestos de la palabra cosa acerca de Wordpress (para mí) es el hecho de que el contenido parece difícil de navegar, difíciles de conseguir, y totalmente contraproducente a veces. Let’s take this blog as it stands right now as an example. Vamos a tomar este blog tal y como está ahora mismo como ejemplo. The homepage has one full post and 9 excerpted posts. La página principal tiene un pleno posterior y 9 puestos extraído. The sidebar contains links to the last 10 posts, and most viewed posts, in addition to a link to categories and monthly archives. La barra lateral contiene enlaces a los últimos 10 puestos, y los más vistos puestos, además de un enlace a las categorías y archivos mensuales. I can also search, and those are my basic options for finding content. También puedo buscar, y esos son mis opciones básicas para la búsqueda de contenido. The custom pages I’ve setup also lead to some article series and categorized content. La costumbre que he páginas de configuración también dar lugar a algunos serie de artículos por categorías y contenido. I currently don’t have an HTML web page site map (just an XML sitemap for search crawlers), so there really is no way to get a birds eye view of all my content. Yo actualmente no tiene una página web HTML mapa del sitio (sólo un mapa web XML para los rastreadores de búsqueda), por lo que realmente no hay manera de obtener una opinión de aves ojos de todos mis contenidos. I’m rapidly approaching 100 posts, but at any give time you’re lucky to have more than 10-15 options for content as you surf around my blog. Me acercaba rápidamente 100 puestos, pero en cualquier momento dar la suerte te acompaña a tener más de 10-15 opciones de contenido que usted practica surf alrededor de mi blog.
Your theme may or may not currently display any more than month based archive pages, which will just be links in your sidebar to the months of the year you had posts. Su tema puede o no mostrar ningún momento más de mes según páginas de archivo, que acaba de ser enlaces en la columna lateral para los meses del año en que había puestos. Some themes also have a calendar. Algunos temas tienen también un calendario. All these normally do is use your “archive.php” in your theme directory as a template to bring up a list of posts the same way you index, search, category, or tag pages do - a list of up 10 to posts at a time with ‘previous’ and ‘next’ links at the bottom of the page. Todos estos suelen hacer es usar su "archive.php" en su directorio tema como una plantilla para mostrar una lista de puestos de la misma manera que su índice de búsqueda, categoría o etiqueta páginas - una lista de hasta 10 a puestos en una tiempo con 'anterior' y 'seguir' los vínculos en la parte inferior de la página. In my experience, most themes don’t have a master archive page (or what the En mi experiencia, la mayoría de temas no tienen una página de archivo maestro (o lo que el Wordpress Codex calls the “Archive Index” Wordpress Codex llama el "índice de archivos" , although some have a “archives.php” file to create one from. , Aunque algunos tienen una "archives.php" archivo para crear uno de. Notice that this template file has an “s” on archives.php. Tenga en cuenta que este archivo de plantilla tiene una "s" en archives.php. Look in your theme directory, and you should have a file named “archives.php”. Busque en el directorio de su tema, y debería tener un archivo llamado "archives.php". If you do add the first 5 lines below at the very top of that file, and the rest of the code in “the loop” of that page (after the header and before the endwhile). Si lo hace añadir los primeros 5 líneas más abajo en la parte superior de ese fichero, y el resto del código en "bucle" de esa página (después de la cabecera y antes de la endwhile). If for some reason your theme doesn’t have an archives.php, just download a copy of your “page.php” file, rename and save it as “archives.php” and then add these code to it (then upload to your theme directory). Si por alguna razón por la cual su tema no tiene una archives.php, sólo tiene que descargar una copia de su "page.php" archivo, cambiar el nombre y guárdelo como "archives.php" y, a continuación, añadir esas claves a él (a continuación, subir a su tema directorio).
<?php /* Template Name: Master Archives Page */ ?> <h2>Archives by Month:</h2> <ul> <?php wp_get_archives('type=monthly'); ?> </ul> <br /> <h2>Archives by Subject:</h2> <ul> <?php wp_list_cats(); ?> </ul> <? php / * nombre de plantilla: Master Page Archives * /?> <h2> Archivos por mes: </ h2> <ul> <? php wp_get_archives ( 'type = mensual');?> </ ul> <br / > Archivos de <h2> Asunto: </ h2> <ul> <? Php wp_list_cats ();?> </ Ul>
Make sure you have the “Template Name” in the top. Asegúrese de que tiene el "nombre de plantilla" en la parte superior. Now upload this file to your theme directory, and in your Wordpress dashboard go to “Write -> Page”. Ahora subir este archivo a tu directorio tema, y en su tablero de instrumentos Wordpress vaya a "Escribir -> Página". On the right hand side you’ll see “page template” as in the image example here. En el lado derecho verás "plantilla de página" como en la imagen de ejemplo aquí. Just select “Master Archives Page”. Sólo tienes que seleccionar "Archivo Maestro Page". I’m going to call mine “Archived Posts Sitemap”. Voy a llamar mía "archivados Puestos Mapa del sitio". I like that title because it says it’s an archive page with a sitemap. Me gusta ese título porque dice que es una página de archivo con un mapa web. To me a sitemap is a great big categorized page of titles and links where you can get a the big picture of a site pretty quickly. Para mí, un mapa del sitio es un gran gran página categorizada de títulos y enlaces donde se puede obtener un panorama general de un sitio bastante rápido. That’s the impression I want to give people, unlike the monthly archive pages that just list posts and excerpts. Esa es la impresión que quiero dar a las personas, a diferencia de las páginas de archivos por mes que sólo la lista de puestos y las citas. The first time creating this page I’m not going to give it much content - just some introductory content. La primera vez la creación de esta página no voy a dar mucho contenido - sólo algunos contenidos introductorios. Save this page and then reload your site in another tab or window. Guarda esta página y, a continuación, vuelve a cargar su sitio en otra pestaña o ventana. You should see the name of this new page in your “Pages” in your sidebar. Usted debe ver el nombre de esta nueva página en sus "Páginas" en la columna lateral. Click on it to bring it up and you should have something like this: Haga clic en él para llevarlo arriba y usted debe tener algo como esto:

You see in that example what you get is a listing of archives by month, and also by subject (category). Usted ve en este ejemplo lo que se obtiene es una lista de archivos por mes, y también por el tema (categoría). This really sucks doesn’t it!? Esto realmente no se chupa!? I mean come on, everyone already has both of these already in their sidebar - I do! Me refiero a venir, todo el mundo ya tiene dos de estos ya en su barra lateral - yo! There are basically two different ways to solve this problem, and actually these solutions can be combined. Existen básicamente dos formas diferentes para resolver este problema, y, de hecho, estas soluciones se pueden combinar. The first thing we can do is get a Wordpress plugin for archives to get more options on this page. La primera cosa que podemos hacer es conseguir un plugin para Wordpress archivos para obtener más opciones de esta página. The second is to do a little hackng and add some code to the page to get the information out of the database we need to make sure visitor’s get all the options they need. La segunda es hacer un poco hackng y añadir algo de código a la página para obtener la información de la base de datos tenemos que asegurarnos de visitante obtener todas las opciones que necesitan.
After reviewing my options - these are my thoughts… Después de revisar mis opciones - estos son mis pensamientos…
I “could” use yesterday’s I "podría" utilización de ayer query_posts hack hack query_posts to list every post I have on the page - but that wouldn’t be very nice visually at all. a la lista de todos los envíos que tengo sobre la página -, pero que no sería muy agradable visualmente a todos. I think it would be great to give visitor’s most “most viewed” or “most popular” posts on this page. Creo que sería mucho para dar más visitantes "más vistos" o "más popular" puestos en esta página. I already have the most viewed top 10 in my sidebar. Ya tengo la más vistos top 10 en mi barra lateral. I use the Yo uso el Lester Chan Plugin WP-PostViews Lester Chan plugin WP-PostViews to get this. para conseguir esto. It will display the most viewed posts, or most viewed posts for a category. Se mostrará el más vistos puestos, o los más vistos puestos de una categoría. I’m going to use it to display the top 25 most viewed posts. Voy a usar para mostrar los primeros 25 puestos más vistos. That’s more than I have in my sidebar and should be very useful to visitor’s. Eso es más de lo que tengo en mi barra lateral y debe ser de gran utilidad para los visitantes. According to the De acuerdo con la WP_PostViews documentation WP_PostViews documentación all I need to do is add this code “outside the loop” of my archives.php to add this to my Master Archives Index Page (since I already ahve WP_PostViews installed as a plugin in my Wordpress installation): todo lo que hay que hacer es añadir este código "fuera del bucle" de mi archives.php añadirlo a mi Maestro Archivos Index Page (desde ya tengo WP_PostViews instalado como un plug-in en mi instalación de Wordpress):
<h2>Top 25 Most Viewed Posts</h2> <?php if (function_exists('get_most_viewed')): ?> <?php get_most_viewed('both', 25) ?> <?php endif; ?> <br /><br /> <h2> Top 25 Más vistos Puestos </ h2> <? php if (function_exists ( 'get_most_viewed')):> <? php get_most_viewed ( «ambos», 25),> <? php endif;?> <br / > <br /> Since you have to use that code outside the loop, and I have a page heading just inside the loop on my archives.php, I decided to place this after the loop in my Master Archives Index page. Dado que usted tiene que usar ese código fuera del bucle, y tengo una página de partida justo en el interior del bucle en mi archives.php, me decidí a este lugar después de que el bucle en mi Maestro página Índice de Archivos. Another way to do this you might care for is by using the Otra forma de hacer esto usted puede ser que la atención es mediante el uso de la using the Top Post plugin Comienzo de la página utilizando el plugin Post by JohnTP to display the top post by category like he does on de JohnTP para mostrar la parte superior puesto de categoría, como lo hace en his top posts page sus principales puestos de página . I decided to stick with what I have so far. Decidí seguir con lo que tengo hasta ahora.
Doing a little more research I found two very similar Wordpress Archiving Plugins, Haciendo un poco más de investigación he encontrado dos muy similares Wordpress Plugins de archivo, SRG Clean Archives SRG Clean Archivos , and , Y Smart Archives Smart Archives . They basically do the same thing, just formatted a little differently. Ellos básicamente hacen lo mismo, sólo un poco el formato diferente.
Here’sa clean archives example where you’ll see that you get monthly archives with linked titles and post counts. He aquí un ejemplo limpio de archivos donde verás que obtienes archivos mensuales vinculados con los títulos y después los cargos. It also shows the day posted before and comment count after each linked title. También muestra el día antes y Nuevo comentario contar después de cada título vinculado.

In the Smart Archives plugin example you’ll see an addition of a linked calendar above the posts by year and month. En el Smart Archivos plugin ejemplo verás una adición de un calendario ligado por encima de los puestos por año y mes. The posts are also listed by month. Los puestos se enumeran también por mes. With this plugin you don’t get date posted or comment count. Con este plugin usted no recibe Fecha de publicación o comentario contar.

In the end I wanted to go with something I thought was not only a bit more cool, but much more user-friedly. Al final yo quería ir con algo que pensé no era sólo un poco más fresco, pero mucho más el usuario friedly. I really wanted to use Realmente quería utilizar Exended Live Archive Exended vivir Archivo because of the interface, but it’s not compatible with Wordpress 2.3+ at all. a causa de la interfaz, pero no es compatible con Wordpress 2.3 + a todos.
In the end I went with Al final me fui con KG Archives KG Archivos for my Master Archives Index page because it has a handy drop down at the top where visitor’s can quickly choose to see one month or all months quickly of archived posts. para mi Maestro página Índice de Archivos, ya que cuenta con un práctico menú desplegable en la parte superior donde el visitante puede seleccionar rápidamente a ver a un mes o todos los meses antes de archivadas. In addition this post lists the date posted and comment count for each as well. Además este puesto enumera la fecha y Nuevo comentario contar para cada uno también.

To place the KG Archives content on your Master Archive Index Page you just have to copy and paste the following code - but this time go back and “edit” your actual “page” in “Manage->Pages” where you wrote the intro content, and paste this beneath (in code view): Para colocar el KG Archivos contenido de su Maestro página Índice de archivos sólo tienes que copiar y pegar el código siguiente - pero esta vez vuelva atrás y en "editar" y su actual "página" en "Administrar-> Páginas", donde escribió la introducción de contenidos , Y pega el bajo (en vista de código):
<kgarchives initialmonth="current" /> <kgarchives initialmonth="current" /> I removed the original code I added at the beginning of this hack tutorial to get archives by month or subject in favor of the KG Archives sortable archive code. Quité el código original he añadido al principio de este hack tutorial para los archivos por mes o sujeto a favor de los Archivos KG sortable Archivo de código. Based on all the options I presented to you in this post - you must decide which of all the layouts and plugins you like best for your archives index page. Sobre la base de todas las opciones que les he presentado en este cargo - deberá decidir cuál de todos los diseños y complementos que te gusta mejor para sus archivos página de índice. View my new Ver mi nuevo Archived Posts Sitemap page here Puestos archivados Sitemap página aquí !
There are many other options in the readme file if you download this plugin, I chose to only display the current month at first. Hay muchas otras opciones en el archivo readme si descargar este plugin, opté por sólo mostrar el mes en curso al principio. Now I have a Master Archive Index Page where users can navigate all my past posts quickly and easily. Ahora tengo una Maestría página Índice de archivos donde los usuarios pueden navegar por todos mis últimos puestos de forma rápida y sencilla. They can even see all posts on one page if they choose. Incluso pueden ver todos los puestos en una sola página si así lo desean. I’ve also listed my most popular posts. También he enumerados mi más populares puestos. If I keep adding pages, I may also expand my Archive Index to include a listing of all my parent and child pages at the very bottom. Si sigo agregando páginas, también se me permite ampliar mis Índice de archivos a incluir un listado de todos mis padres e hijos páginas en la parte inferior. Create your own archive index now! Crea tu propio archivo de índice de ahora! I gave you plenty of options, and as always if you have something to add or a question - please comment now! Yo le dio un montón de opciones, y como siempre, si tienen algo que añadir una pregunta o - por favor, comentar ahora!
Tags: Etiquetas: archives Archivos , plugin , tutorial , wordpress-hacks WordPress-hacks






















We Reward Comments! Nos recompensa comentarios!
We dofollow links, and get your latest blog post as a byline under every new comment from the "CommentLuv" plugin! Estamos dofollow enlaces, y obtener su última entrada en el blog como una p en virtud de cada nuevo comentario de la "CommentLuv" plugin! Top commenters for every month are listed on every page of this site in a sidebar widget linked back to your URL! Top comentaristas de cada mes se enumeran en todas las páginas de este sitio en una barra lateral widget vinculadas a la URL! We would like to reward you for becoming part of our community! Nos gustaría premiar a usted para formar parte de nuestra comunidad! Your comment is valuable not only to us, but also all the other readers of this blog! Tu comentario es valioso no sólo para nosotros, sino también todos los demás lectores de este blog!