Tagged: x
-
AuthorPosts
-
August 10, 2016 at 8:12 pm #1126491
ericshewParticipantHi there,
I would like to create a new widget category for my child theme and then add it to the topbar. Can you please provide me with a walk through for this? Thank you.
August 11, 2016 at 1:28 am #1126791
FriechModeratorHi There,
Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. What do you mean new widget category? If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.
Cheers!
August 11, 2016 at 9:28 am #1127245
ericshewParticipantThe current widgets in X are things like header 1, header 2, header 3, etc.
I would like a widget that said “top bar” and allowed people to add new content in the same way as a normal widget.
Barring that, I would like to have a shortcode or some other way of adding content to the navigation.
Thank you.
August 11, 2016 at 11:15 am #1127388
RahulModeratorHey There,
Thanks for writing in!
You can go thorough the following link for more information regarding your query.
https://community.theme.co/forums/topic/widget-in-topbar-on-renew-theme-7//a>
Let us know how it goes!
August 11, 2016 at 12:15 pm #1127465
ericshewParticipantThat link doesn’t work. Can you send me to link that works? Also: I’m using the Integrity theme. Can you confirm this process will work for that theme?
August 11, 2016 at 1:37 pm #1127567
RupokMemberHi there,
Sorry for the inconvenience. It should be https://community.theme.co/forums/topic/widget-in-topbar-on-renew-theme-7/
Let us know if you need any other assistance.
Cheers!
August 11, 2016 at 10:25 pm #1128255
ericshewParticipantI tried this and didn’t work. I’m not sure if you answered my question: can you confirm that this will work with integrity? Thank you.
August 12, 2016 at 1:56 am #1128403
RupokMemberHi there,
Thanks for writing back. If you want to create a “Widget Area” then it will need some more complex code with functions.php as you need to create a new widget area. It would be out of our support scope as it’s more like a plugin functionality.
But the above thread is a working example to print a shrotcode within the Topbar – https://community.theme.co/forums/topic/widget-in-topbar-on-renew-theme-7/#post-274102
Here goes the actual shortcode printing on the code :
<div class="gwt-wrap"><?php echo do_shortcode('[prisna-google-website-translator]'); ?></div>So you can place your own shortcode and div class to style it your own way.
Hope this makes sense.
August 12, 2016 at 6:46 pm #1129323
ericshewParticipantThis is the third time I’ve asked this question. Can you confirm that this will work with integrity? Thank you.
August 13, 2016 at 1:45 am #1129679
FriechModeratorHi There,
Sorry for the confusion. Yes, that should work on any stacks as the topbar is a global element. To add a topbar widget please follow this step instead.
First navigate to Appearance > Sidebars, create a new sidebar, do not enable this sidebar on any page, and take note of the sidebar ID.
Then navigate to Appearance > Widgets, you should see the newly created sidebar there for you to place some widget.
To call your sidebar on the topbar. Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.
Then on your child theme navigate to this directory: \x-child\framework\views\global\ from there create a new file named _topbar.php and paste the code below in it.
<?php // ============================================================================= // VIEWS/GLOBAL/_TOPBAR.PHP // ----------------------------------------------------------------------------- // Includes topbar output. // ============================================================================= ?> <?php if ( x_get_option( 'x_topbar_display' ) == '1' ) : ?> <div class="x-topbar"> <div class="x-topbar-inner x-container max width"> <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?> <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p> <?php if ( is_active_sidebar( 'YOUR CREATED SIDEBAR ID HERE' ) ) : ?> <?php dynamic_sidebar( 'YOUR CREATED SIDEBAR ID HERE' ); ?> <?php endif; ?> <?php endif; ?> <?php x_social_global(); ?> </div> </div> <?php endif; ?>Replace the YOUR CREATED SIDEBAR ID HERE with your actual sidebar ID, then save.
Provide us your site URL for applying CSS.
Hope it helps, Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1126491 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
