WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. DforDavid
    Member
    Posted 2 years ago #

    Hi,

    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!

    http://wordpress.org/extend/plugins/smart-archives-reloaded/

  2. scribu
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 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

About this Topic

Tags

No tags yet.