Activity Stream
48,167 MEMBERS
6694 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 4 of 4
  1.     
    #1
    I r Super Cop

    Default Help with Listing Archives in Sidebar

    I am trying to reduce the number of archives listed in sidebar from all to 8 months.

    I looked up wordpress.org function reference for help and replaced:

    PHP Code: 
    <?php wp_get_archives ?>
    with

    PHP Code: 
    <?php wp_get_archives('type=monthly&limit=8'); ?>
    I checked the sidebar after this and it hasn't changed anything at all. Could anybody help with resolving this?
    Rox Reviewed by Rox on . Help with Listing Archives in Sidebar I am trying to reduce the number of archives listed in sidebar from all to 8 months. I looked up wordpress.org function reference for help and replaced: <?php wp_get_archives ?> with <?php wp_get_archives('type=monthly&limit=8'); ?> Rating: 5
    Follow besthostingforums on FB

    Looking for an Article Writer? Check out my services here.

  2.   Sponsored Links

  3.     
    #2
    You can call me G
    ^ where did you make this change?



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  4.     
    #3
    I r Super Cop
    sidebar.php
    Follow besthostingforums on FB

    Looking for an Article Writer? Check out my services here.

  5.     
    #4
    You can call me G
    Fixed. For those interested in the solution and the cause of the problem:

    the call to wp_get_archives() was being done inside an if block in this case which was not being executed (the condition being the absence of dynamic_sidebar() )

    Hence to overcome this problem, we can use the `widget_archives_args` hook and add a filter accordingly. Therefore in functions.php

    PHP Code: 
    /* Limit the archive to 8 months
    --------------------------------- */
    function limit_archive($args) {
        
    $args['limit'] = 8;
        return 
    $args;
    }
    add_filter('widget_archives_args''limit_archive'); 



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Left Sidebar or Right Sidebar
    By EsotorisK in forum Polling Plaza
    Replies: 18
    Last Post: 29th Jun 2012, 03:02 AM
  2. [Selling] Pay2Leech FTP - Over 30TB of archives | P2L
    By arsenal4ever in forum Completed Transactions
    Replies: 32
    Last Post: 28th Jun 2011, 02:35 PM
  3. How to add one file to multiple archives
    By outbreak in forum Technical Help Desk Support
    Replies: 3
    Last Post: 27th Apr 2011, 06:49 PM
  4. [Hiring] Unique Uploader/s (Passworded Archives)
    By Exel in forum Completed Transactions
    Replies: 22
    Last Post: 24th Dec 2009, 11:40 AM
  5. Joining MultiPart Archives
    By Agrias in forum Tutorials and Guides
    Replies: 0
    Last Post: 7th Jan 2008, 07:30 PM

Tags for this Thread

BE SOCIAL