• Resolved VirtualWayVA

    (@virtualwayva)


    Awesome plugin!

    Hopefully I haven’t overlooked a Genesis or theme setting somewhere that would accomplish what I’m wanting. I’m envisioning a page with a sidebar containing a tag cloud and/or category quick access links, allowing readers the ability to jump right in on a subject matter.

    Upon searching for instructions elsewhere to accomplish this, I found and added to my (Wellness Pro) child theme’s functions.php the code on “How to set up different sidebars for archives and Pages in Genesis.” However, once I add the tag cloud widget to the newly created page sidebar, I’m realizing I’m not clear on what page to identify in the “if ( is_page” segment of the code. (I even tried changing it to “is_page_template(‘archive-books.php’)” but with no luck. Of course, it could be that my understanding of how this all works is still a bit deficient.)

    Can you please point me in the right direction? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, @virtualwayva!

    You can check if the current page is the books archive like this:

    is_post_type_archive( 'books' )

    Or check that you’re on an individual book page like this:

    is_singular( 'books' )

    These may also be useful:

    – Book author archive: is_tax( 'book-authors' )
    – Book series archive: is_tax( 'book-series' )
    – Book tag archive: is_tax( 'book-tags' )

    Thread Starter VirtualWayVA

    (@virtualwayva)

    Nick @modernnerd, so sorry for the delay in coming back to this. I thought I had my account set to alert me with responses, but somehow missed this.

    I’ve modified the add-on segment in my functions.php as follows, but still the page is showing full width with no sign of a sidebar or other means to add a tag cloud widget.

    if ( is_post_type_archive( 'books' ) ) {
    //* Force content-sidebar layout
    add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' );
    }

    As I’m at least moderately technical, I thought I’d be able to tackle this myself, but now I’m not so sure. ??

    No problem, @virtualwayva, and thanks for explaining your goals in more detail.

    Author Pro uses a custom template loader, so a good way to achieve a content-sidebar layout on the book archive page is to copy the plugin’s book archive template to your theme and make your changes there:

    1. Remove the code you added to functions.php.

    2. Copy the file at wp-content/plugins/genesis-author-pro/templates/archive-books.php to wp-content/themes/author-pro/archive-books.php.

    3. Add this on a line before the closing genesis() call in the theme’s new archive-books.php file that you created:

    add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' );

    You will then see a content-sidebar layout on the book archive page, and can make further modifications to that file to override the default plugin template if you need to.

    You could then add a tag cloud widget to your regular Primary Sidebar, and set it to only appear on the book archive page using a plugin such as https://www.ads-software.com/plugins/widget-logic/.

    Thread Starter VirtualWayVA

    (@virtualwayva)

    Nick / @modernnerd, you are hands down my hero of the week. With the guidance and information you’ve provided, I’ve been able to accomplish what I wanted in just a few minutes. I’m happy to report the hair pulling and head desk frustration is now over. Yay!!

    Thanks so much. You rock!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change layout to add sidebar for tag cloud’ is closed to new replies.