• ResolvedModerator t-p

    (@t-p)


    hi,

    My intention is to switch my blog to WP.

    I am testing 2.8.6. Works great. Need help as follows:

    Question: I am usinf the default theme. Its sidebar displays archive links on amonthly basis (Nov 2009, etc.).

    That’s fine. I like to keep that.

    Additionally, I also like to have an “Archive” link; when users click on it they get a list of ALL blogs todate (in any order – alphabetically, or otherwise, etc.).

    How can I accomplish that? Please help.
    Thanks a lot.
    –tara

Viewing 15 replies - 1 through 15 (of 20 total)
  • If you mean that all post are displayed on a page then that should be what is displayed on the home page of your blog. It will be paginated if you are using the default theme but all your posts should be there.

    Moderator t-p

    (@t-p)

    Thanks eyualmark for so quick response!

    Yes, as mentioned in my post, all blogs archive blogs are displayed in the sidebar.

    But they are displayed on a monthly basis as follows:
    Archives
    November 2009
    October 2009
    September 2009
    August 2009
    July 2009

    Thta’s fine.

    My question is: in addition to that, how can I have them displayed all on a sepaprate page (s) without monthly or yearly bases. I hope I am making myself clear.

    -tara

    Moderator t-p

    (@t-p)

    Anybody?

    How can I create an another archive link (in addition to monthly that already exists in the sidebar), when clicked displays aa list of all blogs 9regardless of the month or year).

    Thanks.

    –tara

    Consider downloading and installing Otto’s PHP Code Widget.

    Then put this in one of those widgets:

    <?php wp_get_archives('type=postbypost&limit=15'); ?>

    Moderator t-p

    (@t-p)

    Thanks MichaelH.

    I will try that.

    –tara

    Moderator t-p

    (@t-p)

    hi,

    how I can open the list in a new page?
    Thanks.

    –tara

    Create a Page Template and put that code in that template, then assign that Template when creating a new page.

    The WordPress Default theme has a wp-content/themes/default/links.php that can be used for that template just replace the wp_list_bookmarks with the wp_get_archives.

    Moderator t-p

    (@t-p)

    Thank a lot MichaelH for youe help and time.

    Following instruction, I created the template and replaced wp_list_bookmarks with the wp_get_archives.

    The name of my new template is gurarchive.php. I created a link as follows:

    • Archives
    • But when I click on that link, i get this error:

      Fatal error: Call to undefined function: get_header() in /home/virtual/siteXXX/fst/var/www/html/testwp/wp-content/themes/default/gurarchive.php on line 12

      line 12 is: <?php get_header(); ?>

      my template looks like this:

      <?php
      /**
      * @package WordPress
      * @subpackage Default_Theme
      */

      /*
      Template Name: gurarchives – it will show all archives of blogs on a separate page
      */
      ?>

      <?php get_header(); ?>

      <div id=”content” class=”widecolumn”>

      <h2>Archive:</h2>

      <?php wp_get_archives(‘type=postbypost&limit=15’); ?>

    </div>

    <?php get_footer(); ?>

    You said in your instructions:

    Create a Page Template and put that code in that template, then assign that Template when creating a new page.

    I did not quite understood the last part of that instruction:

    then assign that Template when creating a new page

    which may have caused the error. I am not sure.

    Please see where I made mistake. Thanks again.

    –tara

    [moderated–bump removed. Please refrain from bumping as per Forum Rules]

    This worked

    <?php
    /*
    Template Name: Links
    */
    ?>
    
    <?php get_header(); ?>
    
    <div id="content" class="widecolumn">
    
    <h2>Archive:</h2>
    
          <?php wp_get_archives('type=postbypost&limit=15'); ?> 
    
    </div>
    
    <?php get_footer(); ?>

    Moderator t-p

    (@t-p)

    Thanks for your help.

    I tried it and got the same Fetal error:

    Fatal error: Call to undefined function: get_header() in /home/virtual/siteXXX/fst/var/www/html/testwp/wp-content/themes/default/gurarchive.php on line 7

    Line 7 is again the same as before:

    <?php get_header(); ?>

    It’s not working suggests possibility of a bug?

    Please refrain from bumping as per

    I opologize. Being a new to WP, i was not aware of the rule in this regard. Thanks for pointing out to me.

    –tara

    It’s not working suggests possibility of a bug?

    Given that the function is being used every minute in thousands of WP blogs, I think that’s highly improbable. More likely an issue in your theme or your page code. Are you using a plain text editor to create the custom template? Have you confirmed that your theme still has a header.php file? Are other pages on your blog working correctly?

    Moderator t-p

    (@t-p)

    Thanks esmi for your time and help.

    1. the blog is working brilliantly. No problem
    2. theme still has a header.php
    3.I tried using both MS Notepad and Notepad++

    I have created a horizontal menubar. In that menu bar, I have this item called “archive”, linked to the template I have created with the code suggeted herein. When I click on the item “archive”, I get the Fetal Error message. here is my test WP site: http://www.gurbani.org/testwp/

    Thanks again for your help.

    –tara

    Try using the code that MichaelH suggested for your custom template.

    Moderator t-p

    (@t-p)

    Thanks esmi,

    MichaelH suggested: “The WordPress Default theme has a wp-content/themes/default/links.php that can be used for that template just replace the wp_list_bookmarks with the wp_get_archives.”

    I tried that before I tried your code, I got exactly the same error: Fatal error: “Call to undefined function: get_header() in /home/virtual/…/testwp/wp-content/themes/default/gurarchive.php on line 12”

    line 12 being: <?php get_header(); ?>

    Here is my test WP site: http://www.gurbani.org/testwp/
    I have created a horizontal menubarbelow the header. In that menu bar, I have this item called “Archive”, linked to the template I have created with the code suggeted herein. When you click on the item “Archive”, you will get the Fetal Error message.

    Everything else works great. I must be missing simething obvious. I am not a programmer or designer, so I cannot see mistake. please help. Thanks.

    I am using default theme with no widgets, no plugins.

    –tara

    Copy the links.php template file in the default theme to your theme. Replace <?php wp_list_bookmarks(); ?> in this copy with <?php wp_get_archives;?>. Change Template Name: Links to Template Name: My Archives.

    Create a new page called “Archives”. Apply this new template (called “My Archives”) to the new page and then publish it.

    Remove your old “Archive” link (which is pointing directly to wp-content/themes/default/gurarchive.php – a real no-no within WP) from your menu bar.

Viewing 15 replies - 1 through 15 (of 20 total)

The topic ‘archive’ is closed to new replies.