Smart Archives Reloaded
[resolved] Using a Custom Post Type and SAR_Custom_Generator together? (3 posts)

  1. DforDavid
    Posted 4 years ago #


    I'd like to use both a custom post type (in my case Portfolio) and the SAR Custom Generator to omit the links to the months. I should be able to do this, right? Is there something wrong with my code?

    In my page template:
    <?php smart_archives('',array('post_type'=>'portfolio'), 'generator=SAR_Custom_Generator'); ?>

    In functions.php:
    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Any help would be much appreciated! Mulțumesc mult!


  2. scribu
    Plugin Author

    Posted 4 years ago #

    You're passing the generator as the third parameter, instead of as the first. This should work:

    <?php smart_archives(
      array( 'generator' => 'SAR_Custom_Generator' ),
      array( 'post_type' => 'portfolio' )
    ); ?>
  3. DforDavid
    Posted 4 years ago #

    Mulțumesc încă odata!

    For those who want to remove the link to the monthly archives via the SAR_Custom_Generator, see here: http://pastebin.com/inzV7JKD

    The notable lines of code are #3 (for the list view) and #23 (where the link code was formerly).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Smart Archives Reloaded
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.