• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Dynamic Buttons in Sidebar Widget?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Dynamic Buttons in Sidebar Widget?

This topic is: not resolved

Tagged: button, dynamic, sidebar widget

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 2 months ago by Victor Font.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 20, 2017 at 2:08 am #199711
    dorisfink
    Member

    I want to have dynamic buttons appear in the sidebar widget of my posts. For example: when user clicks on post, there are buttons in the sidebar widget that correspond to that specific post. The buttons can either download the image in the post or link to another specific image. These buttons in the sidebar are all relative to the specific post — so each post has the same set of buttons, but each button will download and/or link to different items according to the post.

    Is there a code snippet or plugin out there that does this? I hope this makes sense… If you need me to elaborate more, I can.

    Thank you in advance!!!

    January 20, 2017 at 8:06 am #199724
    Victor Font
    Moderator

    What you're asking for sounds like custom coding required. It would work better if you placed the buttons in the post so you can easily manipulate the button targets. The sidebar is not connect to the post content-wise. It's a stand alone entity not associated with the loop that displays the post content. In order to make buttons work in the sidebar the way you want them to work, you need to add custom fields to each post that contain the link targets, or the actual links. You would then display these custom fields in hidden elements within the post content. When a user clicks on either button in the sidebar, a jQuery function would be invoked that reads the appropriate hidden element and redirects the action according to the link.

    Adding custom fields is easy. Reading them and adding them to your post content requires that you modify the loop. This can be tricky to get right. The jQuery should be fairly straight forward. If you're not comfortable coding this yourself, I suggest you find a developer. It should only require 2 to 4 hours to complete.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble