Community Forums › Forums › Archived Forums › Design Tips and Tricks › Change Author Pro Archive Page Layout to add sidebar for tag cloud
Tagged: archive page, Author Pro Plugin, tag cloud
- This topic has 12 replies, 4 voices, and was last updated 7 years ago by
ItsJustMe.
-
AuthorPosts
-
January 6, 2018 at 2:57 pm #215153
ItsJustMe
MemberI am using the Wellness Pro child theme, have added the Author Pro plugin and am now building a library of resource books covering a variety of topics.
I would like to modify the book archive page layout to add a library tag cloud somewhere, either within the page body or in a sidebar, so as to allow viewers to quickly click through and see books grouped by topic category. I'm not finding any setting to help me achieve this, and don't know how to go about customizing the code / layout, assuming that's the route I'd have to take.
Can someone here point me in the right direction?January 7, 2018 at 8:21 am #215166Victor Font
ModeratorYou can force a specific site layout for any page: https://briangardner.com/code/layouts/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?January 7, 2018 at 10:26 am #215176ItsJustMe
MemberThanks, Victor.
I'm apparently not clear on how the pieces and parts all fit together. I grabbed the line of code for the filter that forces the content sidebar layout and added it to Genesis Author Pro > Templates > archive-books.php However, after clearing the cache and refreshing the page, it looks no different. I then added the line of code that sets the layout as a default layout, but again it changed nothing.Even once I'm able to get the layout as I want, I'm not quite sure how I'd go about adding a widget for the tag cloud in the sidebar, as the settings in the Library section (including Archive Settings) provide no means to incorporate widgets.
January 9, 2018 at 11:33 am #215228emasai
ParticipantYou should add your code to the child theme's functions.php, always do this through FTP, never through the Dashboard Editor, white screen of death assured. Save the original functions.php or copy to a text editor in case you make a mistake and need to revert back to the original.
To target a specific page or page-template you would need to add a WordPress conditional tag
You can find the page name by using Developer tools in your web browser and looking at "body class" at the top of the page.
Need Website Customization or a Responsive CSS fix? Contact Me
Lynne emasai.comJanuary 9, 2018 at 12:24 pm #215230ItsJustMe
MemberThanks for the additional guidance; much appreciated.
I'm glad you mentioned the dashboard editor as that's something that has perplexed me in recent weeks. I use to have an editor somewhere, but haven't been able to find it the last few times I've looked. (I've created a couple of websites over the last two or three years, so there are relatively long stretches in between my layout / design efforts, so memory is vague.)
As for finding the page name, the body class shows no page ID, but is instead listed as "archive post-type-archive post-type-archive-books logged-in admin-bar custom-background header-full-width full-width-content gppro-custom genesis-author-pro customize-support". Would I need to specify that entire name?
Once I get this part done, I'm still not clear on how I'd add a tag cloud to a page sidebar since the author pro plugin settings do not include widget options and this page is generated by the plugin.
January 9, 2018 at 12:33 pm #215231emasai
ParticipantYou could use .post-type-archive-books as that is the type of page you wish to target.
You could add a Tag cloud plugin, see HERE
I have never used Author Pro, so I am not familiar with its settings.
Need Website Customization or a Responsive CSS fix? Contact Me
Lynne emasai.comJanuary 11, 2018 at 3:49 pm #215306ItsJustMe
MemberI added a follow-up response (as I'm still having problems), but unfortunately that response is not showing up here. When links to source sites (such as Codex) are included, does that result in responses being temporarily held? (I'm speculating that may be the case, but...)
January 13, 2018 at 1:24 pm #215363ItsJustMe
MemberWell, try as I might, nothing I've attempted has given me the desired results.
Prior to posting my question here, I had added to my child theme the code I found at sridharkatakam on how to set-different-sidebars-archives-pages-genesis
With Victor's suggestion, I then stripped that out and instead added the code to add the filter and force the sidebar, as follows:
if ( is_post_type_archive('post-type-archive-books') ) { //* Force content-sidebar layout add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); }
But again that effected no page change. I don't have a clear enough understanding on how the pieces and parts all work together to know if that was the right condition to use. Reading the instructions and other information I found in Codex (re: Function_Reference/is_post_type_archive) (which mentions the
get_query_var('post_type')
Function_Reference, I'm now totally confused and my brain hurts.Might someone be able to tell me what I overlooked or didn't get right?
Thanks in advance!January 14, 2018 at 9:20 am #215304ItsJustMe
MemberWell, try as I might, nothing I've attempted have given me the desired results.
Prior to posting my question here, I had added to my child theme the code I found here
I then stripped that out and instead added the code to add the filter and force the sidebar, as follows:
if ( is_post_type_archive('post-type-archive-books') ) {
//* Force content-sidebar layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
}But again that effected no page change. I don't have a clear enough understanding on how the pieces and parts all work together to know if that was the right condition to use. Reading the instructions and other information here (which mentions the get_query_var('post_type')), which is here, I'm now totally confused and my brain hurts.
Might someone be able to tell me what I overlooked or didn't get right?
Thanks in advance!January 14, 2018 at 9:24 am #215381Andrea Rennick
MemberOPen up the author pro functions.php file. Find these lines:
// Unregister layout settings.
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );Remove the line for the layout you wish to keep.
Also remove this line:
// Unregister secondary sidebar.
unregister_sidebar( 'sidebar-alt' );Also, you're trying to modify plugin templates via the child theme. You might need to just fork the plugin.
ps. - posts with more than 2-3 links are held in moderation. Doesn't matter where it is linked to.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
January 19, 2018 at 10:18 am #215548ItsJustMe
MemberAndrea, thanks for the suggestion, but I'm not finding a functions.php file for this plugin.
Browsing through the plugin files, I wonder if this segment of code is what's driving the visual result:
require_once( GENESIS_AUTHOR_PRO_FUNCTIONS_DIR . 'template.php' );
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
$Genesis_Author_Pro_Template = new Genesis_Author_Pro_Template( $template );
$template = $Genesis_Author_Pro_Template->template;
}
return $template;
}If so, then I'm guessing any edits to the code would need to add in a second layout and then be specific as to which is used where, because the only front end page generated by the plugin I'm wanting to change is the archive books page (showing all book titles), not the individual book or author pages.
(The archive books page is showing a body class of "archive post-type-archive post-type-archive-books custom-background header-full-width full-width-content genesis-author-pro")As for your closing suggestion ("You might need to just fork the plugin"), unfortunately, I don't know what that's telling me or means.
January 23, 2018 at 11:49 am #215659Andrea Rennick
MemberPlugin files do not have functions.php files. Themes do. I was directing you to add the code to your THEME to override the PLUGIN.
add_filter( 'genesis_pre_get_option_site_layout'
Will only force the initial layout. it will be overridden by a setting.so it has to be add_filter( 'genesis_site_layout'
And the term "forking" in code is a common one that means "In software engineering, a project fork happens when developers take a copy of source code from one software package and start independent development on it, creating a distinct and separate piece of software."
Basically, I was saying you can edit the plugin and rename the plugin itself so it is a new plugin. That is called forking.
This is also complex enough with enough code you may wish to hire a developer.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
January 25, 2018 at 4:13 pm #215740ItsJustMe
MemberAh, got it (the clarification, not [yet] the fix 🙂 ). I guess what threw me was your opening instruction to "OPen up the author pro functions.php file". Since the child theme I'm using is not author pro (I am using the Wellness Pro child theme, have added the Author Pro plugin), I thought you were suggesting that somehow the plugin had its own functions.php file.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.