Community Forums › Forums › Archived Forums › Design Tips and Tricks › moving widget in categories/archive pages.
- This topic has 7 replies, 3 voices, and was last updated 4 years ago by jeffrey.
-
AuthorPosts
-
April 8, 2020 at 1:48 pm #497835LHWCMember
I registered a widget to show on the categories pages is_category().
I'm trying to figure out how to have the widget show below the archive's description for that category.
I set the code to add the widget in genesis_before_loop, but the widget is showing below the breadcrumbs.
I tried moving the code using different hooks but it's not working so I need help.
Does anyone know how I can have the widget placed below the archive's description, above the category posts?
Please look at my site here
You can see the widget with the newsletter subscription box. I want to move it under the "my top picks" section.Thank you so much in advance!
https://livinghealthywithchocolate.com/category/desserts/bars-brownies-fudge/April 8, 2020 at 2:24 pm #497838AnitaKeymasterYou may need a priority on it. Hard to say without seeing your actual code. Install the Genesis Visual Hook Guide plugin. Then go to that page, click the hooks on the navigation and see if there is a hook you can change it to - https://genesistutorials.com/visual-hook-guide/.
Love coffee, chocolate and my Bella!
April 8, 2020 at 3:30 pm #497841LHWCMemberThank you for your reply Anita, I already tried with every hook above the genesis_entry_header hook. None of them work so that's why I'm stuck 🙁
right now my code is:
add_action( 'pre_get_posts', 'change_number_posts_per_category');
function change_number_posts_per_category( $query ) {
if ( is_category() ) {
$query->set( 'posts_per_page', 15 );return $query;
}}add_action( 'genesis_before_loop', 'pink_add_page_content' );
function pink_add_page_content() {
if ( is_category() )
genesis_widget_area ('category-pages', array(
'before' => '<div class="category-pages"><div class="wrap">',
'after' => '</div></div>',
) );
}April 8, 2020 at 3:41 pm #497842LHWCMemberAnita, I used the plugin you suggested and used genesis_before_while and my widget is in the right place now!
For some reason I didn't know about genesis_before_while.
Thank you for your help!
April 8, 2020 at 3:50 pm #497843AnitaKeymasterYour code is mixed up. The top code is saying how many how many posts from the category you want displayed on the page.
The second part of that is for your widget. So that 15 priority doesn't matter.
Try this line:
add_action( 'genesis_archive_title_descriptions', 'pink_add_page_content', 15 );
I tested my own code with that on a staging and it puts the widget below the archive description.
Love coffee, chocolate and my Bella!
April 8, 2020 at 3:52 pm #497844AnitaKeymasterOops that's not your priority that setting 15 per page. Duh.
Love coffee, chocolate and my Bella!
April 8, 2020 at 3:57 pm #497846AnitaKeymasterYou're welcome! I install that plugin all he time.
Love coffee, chocolate and my Bella!
April 15, 2020 at 4:48 am #497967jeffreyParticipantHi there guys. I see you're both good in genesis framework. I also have a website using magazine pro theme
My site: https://staging.americanwholehealth.com/category/food-cache/
I want to configure my category page to have a post title above the featured image and the timestamp will be move under featured Image. Hope you can help me on my problem.
By the way I'm new on magazine pro and genesis framework.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.