Support

Account

Home Forums General Issues Text field to display in Sidebar

Solving

Text field to display in Sidebar

  • I want to create a field, edit a text name with some class, and that the text entered on each page in that field will appear in the sidebar.
    For example, if you name this field – “FILEDNAME”,
    What code I need in php or other in the page code,
    And the code I need to put in the sidebar widget,
    For the content I enter in this field (different on each page) to appear in the sidebar?

  • You need to edit the template file for your sidebar, usually something link sidebar.php and then follow the documentation on displaying the value, usually something like the_field('my_field_name');

  • I will explain again:
    I created a “text area” field in ACF.
    For example, his name is: “Filed_Sidebar”.

    I want to edit html / css in this field, for example, enter text like this:
    <p class = “class1”> text </p>

    And that the content entered in this field appears in the Sidebar.

    Can you explain to me exactly the steps I need to do?

    I created a field, and I don’t know how to continue from here.

  • This depends on your theme. Most themes have php file called “sidebar.php”, however, other themes are more complex. There may be different sidebar files for different sidebars used in different locations. You need to figure out what file you need to edit by looking at the code of your theme.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Text field to display in Sidebar’ is closed to new replies.