Display ACF the_field within Custom Sidebar (Genesis)

Trying to do what I thought was an easy task, but running around in circles trying to find a solution…

Objective: Have a different sidebar with a contact form that utilizes ACF on the individual post.

Problem: The ACF form is easy but I can't figure out how to simply get the display code into the custom sidebar. For example purposes, let's just use: <p><?php the_field('field_name'); ?></p>.

I have done this many times with a simple ACF built out custom theme, where all documentation works with normal WordPress (edit functions.php, add sidebar.php file, clone single.php and add code to only use the new sidebar based Categoryor Custom Post Type.

But for this client, we are using a Genesis theme which I have little experience with and seems to cause issues in how sidebars are organized, or maybe I just can't find where to make changes.

I can create a custom sidebar within Genesis, but not sure where to add the PHP code since I know widgets cant have PHP code.

This is basically exactly what I'm looking to achieve but on the Genesis framework.

Any help would be awesome, I feel like it should be way easier than this.

1 Comment
  1. for example, tried adding a sidebar.php file to the child as a clone from “Genesis” theme and then edited the sidebar.php code:

    /** Fires to display the main Primary Sidebar content.*/

    if ( in_category(‘resource’) ) {

    <p>123</p>;

    }else{

    do_action( ‘genesis_sidebar’ );

    }

    but no luck, site broke…

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer