Ελεύθερος έλεγχος για Bloggers - σημάδι επάνω σε 5 λεπτά!
Τροφοδοτημένος από MaxBlogPress

Αμυχή Wordpress #2: Πώς να δημιουργήσει μια κύρια σελίδα δεικτών αρχείων | Λάθη Blogging JTPRATT
Λάθη Blogging JTPratt


Σπίτι » Wordpress αμυχή #2: Πώς να δημιουργήσει μια κύρια σελίδα δεικτών αρχείων



Ταχυδρομημένος σε:

εικόνα κατηγορίας blog-οργάνωσης wordpress εικόνα κατηγορίας
514 απόψεις


Παρακαλώ σημειώστε: Αυτή η σελίδα γράφτηκε αρχικά στα αγγλικά.

Η αρχική θέση μπορεί να αντιμετωπισθεί εδώ.

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.


Στο Wordpress σας blog έχετε έναν sortable καθαρό και εύκολο τρόπο για τους επισκέπτες να έχετε πρόσβαση στις προηγούμενες θέσεις σας; Εκτός από τη βασισμένη στο μήνα σύνδεση αρχείων στην πλαϊνή μπάρα σας, δεν μπορείτε να έχετε έναν δείκτη αρχείων καθόλου! Είναι χρόνος που χαράξατε την κύρια σελίδα δεικτών αρχείων σας!

Αυτό είναι Wordpress αμυχή #2 σε 30 μας «αμυχή-α-Thon»! Αυτός είναι σωστός, πρόκειται να σας δώσω ενός Αμυχή Wordpress ανά ημέρα για 30 ημέρες, και στο τέλος εκείνου του χρόνου που θα έχετε ασκήσει σωματεμπορία έξω το blog σας όπως σας δεν θα είχε θεωρήσει ποτέ πιθανό! Να είστε βέβαιος στη συμφωνία για την τροφή RSS ή προσυπογράψτε με ηλεκτρονικό ταχυδρομείο στην κορυφή της σελίδας.

Από το κιβώτιο η προεπιλογή αρχειοθετεί γιατί Wordpress δεν είναι πολύ προκλητικό. Στην πραγματικότητα, όπως έχω αναφέρει στις προηγούμενες θέσεις το πράγμα λέξης για Wordpress (σε με) είναι το γεγονός ότι το περιεχόμενο φαίνεται σκληρό να πλοηγηθεί, σκληρό να φταθεί, και ειλικρινές να μόνος-νικήσει κατά περιόδους. Πάρτε αυτό το blog ως έχει αμέσως για παράδειγμα. Η αρχική σελίδα έχει μια πλήρη θέση και 9 οι θέσεις. Η πλαϊνή μπάρα περιέχει τις συνδέσεις με τις τελευταίες 10 θέσεις, και τις περισσότερες αντιμετωπισμένες θέσεις, εκτός από μια σύνδεση με τις κατηγορίες και τα μηνιαία αρχεία. Μπορώ επίσης να ψάξω, και εκείνες είναι οι βασικές επιλογές μου για ικανοποιημένος. Οι σελίδες συνήθειας έχω την οργάνωση να οδηγήσει επίσης σε κάποια σειρά άρθρου και ταξινομημένο περιεχόμενο. Αυτήν την περίοδο δεν έχω έναν χάρτη περιοχών ιστοσελίδας HTML (ακριβώς ένα XML sitemap για τις αντιολισθητικές αλυσίδες αναζήτησης), έτσι πραγματικά δεν υπάρχει κανένας τρόπος να αποκτηθεί μια άποψη ματιών πουλιών όλου του περιεχομένου μου. Πλησιάζω γρήγορα 100 θέσεις, αλλά σε οποιεσδήποτε δίνω το χρόνο που είστε τυχεροί να έχετε περισσότερες από 10-15 επιλογές για το περιεχόμενο όπως κάνετε σερφ γύρω από το 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. Some themes also have a calendar. 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. In my experience, most themes don’t have a master archive page (or what the Wordpress Codex calls the “Archive Index”, although some have a “archives.php” file to create one from. Notice that this template file has an “s” on archives.php. Look in your theme directory, and you should have a file named “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). 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).

<?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>

page template example Make sure you have the “Template Name” in the top. Now upload this file to your theme directory, and in your Wordpress dashboard go to “Write -> Page”. On the right hand side you’ll see “page template” as in the image example here. Just select “Master Archives Page”. I’m going to call mine “Archived Posts Sitemap”. I like that title because it says it’s an archive page with a sitemap. 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. That’s the impression I want to give people, unlike the monthly archive pages that just list posts and excerpts. The first time creating this page I’m not going to give it much content - just some introductory content. Save this page and then reload your site in another tab or window. You should see the name of this new page in your “Pages” in your sidebar. Click on it to bring it up and you should have something like this:

archive index example

You see in that example what you get is a listing of archives by month, and also by subject (category). This really sucks doesn’t it!? I mean come on, everyone already has both of these already in their sidebar - I do! There are basically two different ways to solve this problem, and actually these solutions can be combined. The first thing we can do is get a Wordpress plugin for archives to get more options on this page. 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.

After reviewing my options - these are my thoughts…

I “could” use yesterday’s query_posts hack to list every post I have on the page - but that wouldn’t be very nice visually at all. I think it would be great to give visitor’s most “most viewed” or “most popular” posts on this page. I already have the most viewed top 10 in my sidebar. I use the Lester Chan Plugin WP-PostViews to get this. It will display the most viewed posts, or most viewed posts for a category. I’m going to use it to display the top 25 most viewed posts. That’s more than I have in my sidebar and should be very useful to visitor’s. According to the WP_PostViews documentation 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):

<h2>Top 25 Most Viewed Posts</h2>
<?php if (function_exists('get_most_viewed')): ?>
   <?php get_most_viewed('both', 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. Another way to do this you might care for is by using the using the Top Post plugin by JohnTP to display the top post by category like he does on his top posts page. I decided to stick with what I have so far.

Doing a little more research I found two very similar Wordpress Archiving Plugins, SRG Clean Archives, and Smart Archives. They basically do the same thing, just formatted a little differently.

Here’s a clean archives example where you’ll see that you get monthly archives with linked titles and post counts. It also shows the day posted before and comment count after each linked title.

clean archives example

In the Smart Archives plugin example you’ll see an addition of a linked calendar above the posts by year and month. The posts are also listed by month. With this plugin you don’t get date posted or comment count.

smart archives example

In the end I wanted to go with something I thought was not only a bit more cool, but much more user-friedly. I really wanted to use Exended Live Archive because of the interface, but it’s not compatible with Wordpress 2.3+ at all.

In the end I went with KG Archives 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. In addition this post lists the date posted and comment count for each as well.

KG Archives example

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):

<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. 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. View my new Archived Posts Sitemap page here!

There are many other options in the readme file if you download this plugin, I chose to only display the current month at first. Now I have a Master Archive Index Page where users can navigate all my past posts quickly and easily. They can even see all posts on one page if they choose. I’ve also listed my most popular posts. 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. Create your own archive index now! I gave you plenty of options, and as always if you have something to add or a question - please comment now!


Tags: , , ,

Question or Comment?? Spill it Now...

Jumping for Joy over comments!

We Reward Comments!


We dofollow links, and get your latest blog post as a byline under every new comment from the "CommentLuv" plugin! Top commenters for every month are listed on every page of this site in a sidebar widget linked back to your URL! We would like to reward you for becoming part of our community! Your comment is valuable not only to us, but also all the other readers of this blog!

 


Click to add smilies to your post! = =[] ^=( =(( =(| =)r =|8 =0 =)~ =00 =( =;; =)] =;;;