Wordpress Hack #14: 12 Ways to Hack Your Home Page Hack Wordpress # 14: 12 Maneras de Hack tu página de inicio
2,224 views - 2.224 puntos de vista -Posted in: Publicado en:
2,224 views 2.224 visitas
Please note: This page was originally written in English. Por favor nota: 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.
To have a unique Wordpress blog home page you don’t have to create your own theme. Para tener un blog Wordpress única página de inicio no tiene que crear su propio tema. I’ll show you 12 ways to hack your homepage without getting a new theme that will make your blog stand out from the pack! Te mostraré 12 maneras de hackear la página principal sin obtener un nuevo tema que hará que su blog se destacan de la manada!
This is installment #14 of Esta cuota es de # 14 30 Wordpress Hacks in 30 Days 30 Wordpress Hacks en 30 Días , be sure to sign up to our RSS feed or email updates at top right of this page!W , Asegúrese de registrarse a nuestro feed RSS o correo electrónico las actualizaciones en la parte superior derecha de esta página! W
Everyone wants their blog to be different. Todo el mundo quiere que su blog a ser diferente. You want it to be unique, to stand out, while remain easy to present what it is your blog is about. ¿Quieres que sea única, a ponerse de pie, mientras que siguen siendo fácil de presentar lo que es su blog se trata. The same old “rolling list of posts” and obigatory sidebar can get (real) old after awhile. La misma vieja "lista de los puestos" y obigatory barra lateral puede obtener (real) de edad después de un rato. Out of the box, everybody’s Wordpress blog looks the same, and getting a custom theme is the first stab at breaking out of that box. Fuera de la caja, todo el mundo del blog Wordpress tiene el mismo aspecto, y conseguir un tema personalizado es la primera puñalada a salir de esa caja. The next step (before creating your own theme from scratch) is hacking that theme up a bit to get more of what you want out of it. El siguiente paso (antes de crear su propio tema desde cero) que la piratería es un tema poco para conseguir más de lo que quieres de él. While some of the techniques I’m about to show you can be used on nearly any page in your Wordpress blog, the focus of this article is “ ways you can hack your Wordpress home page! ” Si bien algunas de las técnicas que estoy a punto de demostrar que se puede utilizar en casi cualquier página de tu blog Wordpress, el enfoque de este artículo es "maneras de hackear su página de Wordpress!"
*All the plugins mentioned on this page are * Todos los plugins mencionados en esta página son listed on the Wordpress 2.5 Compatibility list* que figuran en el Wordpress 2.5 Lista de compatibilidad de *
1. 1. Organize posts in 2 Side by Side Columns : Maybe you are tired of that one-column of content on your homepage, and you want more of a magazine or newspaper layout approach. Organizar puestos en 2 Side by Side Columnas: Tal vez usted está cansado de que una columna de contenido de su página principal, y desea más de una revista o periódico enfoque de diseño. If so, breaking up your posts into 2 side by side columns of content could be good for you. Si es así, romper sus entradas en 2 al lado de las columnas de contenido podría ser bueno para usted. I can’t take credit for this hack, it’s well explained, including where to put the code and which files to edit - over on the No puedo tomar crédito para este hack, es bien explicado, incluidos los casos en que para poner el código y que para editar los archivos - sobre más de la Crea8 Design Blog: Side by Side Wordpress Columns Crea8 diseño de blog: al lado de las columnas Wordpress .
2. 2. Create Custom Comment Counts : Here’sa hack that I desperately tried to figure out for months and months, and never really found the answer to all in one place. Crear Cuenta comentario personalizado: He aquí un truco que me trató desesperadamente de averiguar durante meses y meses, y nunca encontró la respuesta a todos en un solo lugar. I ended up finding the answer not in a blog post, but in theme code instead. Terminé encontrando la respuesta no en un post en un blog, pero en el tema en lugar de código. Some of the best bloggers sites that I read have some post meta-information in the title header, including a comment count. Algunos de los mejores bloggers sitios he leído que algunos han puesto de meta-información en el título de cabecera, entre ellos contar con un comentario. Usually it’s also a link, and sometimes it has a cool little comment bubble or a phrase like “What do you have to say?” Por lo general, es también un vínculo y, a veces tiene un poco de frío comentario burbuja o una frase como "¿Qué tiene usted que decir?"
Normally to just get a “comment count”, you see code like this in a theme: Normalmente sólo recibir un "comentario contar", verá código como este en un tema:
<?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> After “comments_popup_link” the text inside the three sets of quotes represents what should be printed out if there are no comments yet, only one comment, or more than one comment. Después de "comments_popup_link" el texto dentro de los tres conjuntos de comillas representa lo que debe ser impreso si no hay observaciones, sin embargo, sólo un comentario, o más de un comentario. You modify the text to say whatever you want here. Modificar el texto para decir lo que quieras aquí. You could change ‘No Comments’ to ‘Be the first to comment…’, etc. But, if you’re like me you probably want to spice it up a bit and add a nice little comment icon. Usted podría cambiar "Sin comentarios" a "Sea el primero en comentar ...", etc, pero si eres como yo que usted probablemente querrá especias que un poco y añadir un comentario poco agradable icono. If so, use this code: Si es así, utilice este código:
<?php $comments_img_link= '<img src="/wp-content/themes/mytheme/images/comments-icon.gif" title="comments" alt="comments" />'; comments_popup_link($comments_img_link .' Comments(0)', $comments_img_link .' Comments(1)', $comments_img_link . ' Comments(%)');?> In the first line just change the path your theme image directory and copy and past the code wherever you want the comment count and icon to appear for your home page posts. En la primera línea acaba de cambiar la ruta de su directorio de imágenes de tema y copiar y pasado el código siempre que lo desee contar con el comentario y que aparezca el icono de su página de puestos de trabajo.
Unique Ads Between Posts : This technique can be used to place most anything in between the posts in “the loop” on your home page, I used it to display adsense ads after the 2nd and 6th posts (in the loop of 10). Único entre los puestos de anuncios: Esta técnica se puede utilizar para algo más lugar entre los puestos de "el lazo" en su página de inicio, lo he usado para mostrar anuncios de AdSense después de la 2 ª y 6 puestos (en el bucle de 10). It doesn’t have to be an ad - it could be used to show image dividers between each post, random quotes, special links - anything. No tiene que ser un anuncio - que podría ser utilizada para mostrar la imagen entre los divisores de cada puesto, al azar citas, enlaces especiales - nada.
First - I’ll show (again) what “the loop” basically looks like: En primer lugar - Voy a mostrar (de nuevo) lo que "el bucle", básicamente, tiene el siguiente aspecto:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <p class="postmetadata"><?php the_time('F jS, Y') ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','',' |'); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p> </div> <?php endwhile; ?> “The Loop” in Wordpress is a function that retrieves from your database a series of (10) posts. "El Lazo" en Wordpress es una función que recupera de su base de datos una serie de (10) puestos. It starts out with the “have_posts” line and ends with the “endwhile” line. Se inicia con la "have_posts" línea y termina con el "endwhile" línea. It’s called the loop because it does the same thing over and over - one post at a time. Se llama el bucle porque la misma cosa una y otra vez - un puesto en un momento. That’s why inside “the loop” is the code to print the time, category, comment count, and whatever miscellaneous things are in your themes loop. Es por eso que dentro de "bucle" es el código para imprimir el tiempo de la categoría, contar comentario, y cualquiera que sea las cosas son diversos en temas de su bucle. You loop might be slightly different than my example for just that reason, different details are displayed for posts in different themes. Usted bucle podría ser ligeramente diferente de mi ejemplo, por sólo esta razón, los diferentes detalles se muestran para los puestos en los diferentes temas. That’s the beauty of being able to “hack wordpress” - you can easily change those details. Esa es la belleza de ser capaz de "hack wordpress" - se puede cambiar fácilmente los detalles.
What we’re going to do is insert a “counter” in the loop, and then tell it to do something when it reaches certain numbers in the count. ¿Qué vamos a hacer es insertar una "contrarreforma" en el bucle y, a continuación, decir que de hacer algo cuando se llega a determinados números en el conteo. Here’s the modified code to do that: Aquí está el código modificado para hacerlo:
<?php if (have_posts()) : ?> <?php $count = 1 ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <p class="postmetadata"><?php the_time('F jS, Y') ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit','',' |'); ?> <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p> </div> <?php if ($count==2) { include('advert1.php'); } ?> <?php if ($count==6) { include('advert2.php'); } ?> <?php $count = $count + 1; ?> <?php endwhile; ?> You’ll notice in this modified example that on the second line we have inserted a counter that starts with “1″ the first time through. Usted notará en este ejemplo, que modificó en la segunda línea que hemos insertado un contador que empieza con "1" el primer tiempo a través de. The second to the last line (count + 1) ads one number to the counter each time through so it can keep track of which post we’re on. La segunda a la última línea (contar + 1) los anuncios de un número a la contra cada vez que a través de lo que puede hacer un seguimiento de lo que después nos encontramos en las. The two lines before that say “if the counter is on #2 or #6 - include this file”. Las dos líneas antes de decir que "si el contador está en # 2 o # 6 - incluir este archivo". I created 2 files, both advert1.php and advert2.php and placed them in my theme directory. He creado 2 archivos, tanto advert1.php y advert2.php y colocado en mi directorio tema. When the counter reaches 2 or 6 it opens those files and prints the contents to the page. Cuando el contador llegue a 2 o 6 que abre los archivos y el contenido se imprime a la página. For my home page, both those files contain the adsense code to be displayed in those spots. Para mi página de inicio, tanto los archivos contienen el código de AdSense que se muestran en los spots. As I said - you could include anything, and you can name those file whatever you want. Como ya he dicho - que podría incluir cualquier cosa, y usted puede nombrar los archivos lo que quieras. In addition, you can change, modify, or add lines to the counter for any number 1-10 as well. Además, puede cambiar, modificar, o agregar líneas a la contra para cualquier número 1-10 como así.
3. 3. Dump the Next and Previous : I’ve always hated those “previous posts” link on the bottom of every Wordpress homepage. Volcado de la Siguiente y Anterior: Siempre he odiado los "anteriores" que aparece en la parte inferior de cada página de Wordpress. I want my visitor’s (especially the first time ones) to know that I have many pages of content they can peruse, and a numbered list (like navigation at google) tells them just that. Quiero que mi visitante (especialmente el primer tiempo) para saber que tengo muchas páginas de contenido pueden leer, y una lista numerada (como la navegación en Google) les dice precisamente eso. They can easily jump back to page 3, or 6, or whatever to view previous posts, and then back again. Ellos pueden saltar fácilmente de vuelta a la página 3, o 6, o lo que sea para ver entradas anteriores y, a continuación, volver otra vez. Wordpress’ pagination feature of only one page at a time is terrible at best. Wordpress' característica de paginación sólo una página a la vez es terrible, en el mejor. The El WP Page Numbers Wordpress plugin WP números de página Wordpress plugin takes care of this seamlessly. se encarga de esta perfección. *Note, this plugin can also be used all other templated pages where more than one page of posts are retrieved. * Nota, este plugin se puede utilizar también todas las demás plantillas, páginas en las que más de una página de los puestos se recuperan.
4. 4. Homepage Excerpts : If you want to control how many posts on your home page are displayed full and how many to show as excerpts (without mucking in any code at all), Página de Inicio Extractos: Si desea controlar el número de puestos en la página principal se muestra plena y cuántos para mostrar como extractos (sin mucking en cualquier código en absoluto), Homepage Excerpts Página de Inicio Extractos is the plugin you need. es el plugin que necesita. I use this on most of my Wordpress sites, and you basically configure it with 1 click (how many posts to display full). Lo utilizo en la mayoría de mis sitios Wordpress, y básicamente hay que configurarlo con 1 clic (cuántos puestos para mostrar su totalidad).
5. 5. Enable Post Voting : You could enable a voting function by using Habilitar puestos de votación: Usted podría permitir que un voto mediante el uso de la función Vote It Up Votación hasta que enabling your Wordpress readers to vote for your posts Digg or Reddit style, and then put a list of most popular ones at the top of your homepage like this: Wordpress permite a sus lectores a votar a favor de sus puestos de Digg o Reddit estilo y, a continuación, poner una lista de los más populares en la parte superior de la página principal de este modo:

6. 6. Random Featured Post : Use your old posts and give them new life, by creating featuring a random post before your content on your home page using the Las aleatoria Post: Usa tu viejo puestos y darles nueva vida, con la creación de un puesto de azar antes de que su contenido en la página principal utilizando el Random Featured Post Wordpress Plugin . Las posteriores al azar Wordpress Plugin. You might also try También puede intentar Advanced Random Post Avanzada aleatorio puesto . .
7. 7. Display an Accouncement : Using the Mostrar una Accouncement: Uso de la Genki Announcement Genki Anuncio plugin you can display an announcement before your posts on the homepage. plugin puede mostrar un anuncio antes de que sus puestos en la página principal. This is great, because you don’t have to hack any code to do this, you can turn the message on or off whenever you want, and you can even restrict it to differerent roles or users if you need to. Esto es genial, porque no tienes que piratear cualquier código para hacer esto, usted puede convertir el mensaje o desactivar siempre que lo desee, y puede incluso restringir a differerent funciones o usuarios si es necesario. There’s even a timer feature to turn the announcement on or off. Hay incluso una función de temporizador para activar el anuncio de encendido o apagado. Your message could be holiday related (Merry Christmas!), or a time advertisement (for 48 hour only), a message (to all site admins), or everyone (thanks for visiting my blog!). Su mensaje podría ser relacionados con las vacaciones (¡Feliz Navidad!), O un anuncio tiempo (durante 48 horas solamente), un mensaje (a todos los administradores de sitio), o todo el mundo (gracias por visitar mi blog!).
8. 8. Make a Post “Sticky” : Instead of an announcement or a random post, maybe what you want to do is make one particular post “sticky” - or have it stay at the top of the homepage (until you change it). Hacer un post "sticky": En lugar de un anuncio o un puesto de azar, tal vez lo que quiere hacer es un puesto "sticky" - o que se permanezca en la parte superior de la página de inicio (hasta que lo cambie). Easy enough, Lester Chan’s Fácil suficiente, Lester Chan's Creating a Dynamic Sticky Creación de una dinámica pegajosa “. ". Basically he figured out how to create “two loops” on the homepage. Básicamente él figuraba cómo crear "dos bucles" en la página principal. The first loop gets one post from one category. El primer bucle es un puesto de una categoría. Basically he created a new category called “frontpage” and assigned all the articles he wanted to “feature” for a time. Básicamente, él creó una nueva categoría denominada "FrontPage" y asignado todos los artículos que quería "característica" de una vez. Then the first loop shows one featured article at a time in a styled div box. Entonces el primer bucle muestra un artículo destacado en un momento en un cuadro de estilo div. Then, immediately following the normal loop gets the 10 latest posts from the database, but it does check to ensure that it doesn’t duplicate the featured post again. Luego, inmediatamente después de la bucle es normal los 10 últimos puestos de la base de datos, pero sí de verificación para asegurarse de que no duplica el destacado puesto de nuevo. Very nice hack! Muy bonito truco!
10. 10. Edit Article Excerpts : Modificar el artículo extractos: Wordpress Excerpt Editor Extracto editor de Wordpress is a unique plugin that allows you to add custom excerpts for page (something you can’t do without a plugin). es un único plug-in que te permite añadir las citas de la página (algo que no puede prescindir de un plugin). Normally, if you choose to use excerpts - Wordpress will take the first so many words of your posts. Normalmente, si usted elige utilizar extractos - Wordpress tendrá el primer tantas palabras de sus puestos. As far as your homepage is concerned, this doesn’t do much for “original content” or avoiding “duplicate content” at all. En lo que respecta a su página principal se refiere, este no hace mucho de "contenido original" o evitar "contenido duplicado" en absoluto. This plugin enables you write a custom excerpt for each post or page, as you write it. Este plugin te permite escribir un extracto personalizado para cada puesto o la página, como usted escribe. Then, if you use excerpts on your homepage - the custom excerpt will be dispayed instead of the first “x” words making your home page contain completely unique content. Entonces, si usted utiliza extractos en su página principal - el extracto personalizado se dispayed en lugar de la primera "x" las palabras que su página de inicio contener completamente singular contenido. It also allows you to write some different linkbait enticing people to click and view that article. También le permite escribir algunas diferentes linkbait atraer a la gente a hacer clic y ver que en el artículo. It has options to do the same for both archive and tag pages. Tiene opciones para hacer lo mismo para ambos archivos y páginas de etiqueta.
Excerpt Editor also has some advanced options for showing excerpts of “x” recent posts under each Post/Page and it can even show excerpts from “x sub pages” on each page. Extracto Editor también tiene algunas opciones avanzadas para mostrar extractos de "x" los últimos puestos en cada puesto / Page e incluso puede mostrar extractos de "x sub páginas" en cada página. With all these options, it can do many things beyond custom excerpts on your home page. Con todas estas opciones, puede hacer muchas cosas más allá de la costumbre extractos en su página de inicio.
11. 11. Add Thumbnails to Your Posts Using Custom Fields : There are many, many ways to add images to posts either manually or with a plugin. Miniaturas Añadir a tus entradas Uso de campos personalizados: Hay muchas, muchas maneras de añadir imágenes a los puestos, ya sea manualmente o con un plugin. Once of the most overlooked features of Wordpress is the “custom field”. Una vez que la mayoría de los pasa por alto las características de Wordpress es el "campo personalizado". You have the ability to create and fill-in custom fields with every post you write, but probably don’t know it. Usted tiene la capacidad de crear y llenar de campos personalizados con cada post que escriba, pero probablemente no lo saben. Under every “write post” page is the “custom fields” form (this one from WP 2.5): En virtud de todos los "post escribir" la página es el "campos personalizados" la forma (esto una de WP 2.5):

A custom field is nothing more than metadata that you create. Un campo personalizado no es más que metadatos que cree. You probably know metadata as keywords and descriptions for search engines, but you can make your own custom metadata fields to describe or enhance your posts. Usted probablemente sabe como palabras clave de metadatos y descripciones para los motores de búsqueda, pero usted puede hacer sus propios campos de metadatos para describir o mejorar sus puestos. Each custom field has a “key” and then a “value”. Cada campo personalizado tiene una "clave" y, a continuación, un "valor". The key is the name of the metadata (like Image or thumbnail) and the value is the content (like file.gif or picture.jpg). La clave es el nombre de los metadatos (por ejemplo, o la imagen en miniatura) y el valor es el contenido (como file.gif o imagen.jpg). Just Tadlock has a pretty good Sólo Tadlock tiene una muy buena Introduction to Custom Fields Introducción a los campos personalizados , and also , Y también Custom Fields: Adding Images to Posts Campos personalizados: añadir imágenes a los puestos .
12. 12. Create a Date Button for Posts : Seems like most of the more “premium” Wordpress themes (and hand-crafted ones) have a “date button” for the post, a nice image with the month abbreviation and the date (sometimes the day of the week too). Fecha de crear un botón de Correos: Parece que la mayoría de los más "prima" temas de Wordpress (y artesanales más) tienen una "fecha botón" para el puesto, una buena imagen con la abreviatura del mes y la fecha (a veces el día de la semana también). Small Potato at WP-Designer wrote a great tutorial last year on Pequeños Papa en WP-Designer escribió un gran tutorial sobre el año pasado How to Create a Date Button Cómo crear un botón de Fecha .
I hope these home page hacks helped you, and as always if you have something to add to make this post better (or a question) - please comment now! Espero que estos hacks página de inicio ayudó a usted, y como siempre si tiene algo que añadir a hacer mejor este puesto (o una pregunta) - por favor comentario ahora!
Tags: Etiquetas: diy , help ayuda , wordpress-hack wordpress-Hack




















May 6th, 2008 at 8:22 pm 6 de mayo, 2008 a 8:22 pm
I finally understand what the “loop” is. I finalmente entender lo que el "bucle" es.
I was looking for an easy way to put an introduction-explanation-welcome on one of my sites and the sticky plugin looks like it will work well Estaba buscando una manera fácil de poner una introducción-explicación-bienvenida, en uno de mis sitios y el pegajoso plugin parece que funcionan bien
Pauls last blog post..1 Pauls último blog .. 1
May 18th, 2008 at 1:30 pm 18 de mayo de 2008 a la 1:30 pm
Your “creating a dynamic sticky” link is swallowing some of your code. Su "crear una dinámica pegajosa" vínculo es tragar algunos de su código. You might be missing a tag in there. Es posible que falte una etiqueta en ella.
Great post, though. Gran post, aunque. :) :),
Erikas last blog post..1 Erikas último blog .. 1
May 21st, 2008 at 9:37 am 21 de mayo de 2008 a 9:37 am
[...] Wordpress Hack #14: 12 Ways to Hack Your Home Page | JTPRATT’s Blogging Mistakes [...] [...] Wordpress Hack # 14: 12 Maneras de Hack tu página de inicio | JTPRATT del Blogging errores [...]
July 27th, 2008 at 11:03 am 27 de julio de 2008 a 11:03 am
Thanks very much for these hacks. Muchas gracias por estos hacks. Just what I wanted to enhnace my blog without resorting to plugins. Justo lo que quería enhnace mi blog sin tener que recurrir a plugins.
MyZeroWastes last blog post.. MyZeroWastes último blog .. Sunday roundup Domingo Roundup
November 19th, 2008 at 8:07 pm 19 de noviembre de 2008 a 8:07 pm
Great post! Gran post! I’m going to implement the WP page numbers. Voy a aplicar el WP números de página. thanks! gracias!
Akiyamasans last blog post.. Akiyamasans último blog .. make a difference to a Soldier in 60 seconds hacer una diferencia a un soldado en 60 segundos