Viewing 4 replies - 1 through 4 (of 4 total)
  • Do you mean, you want to have one Text Widget in the sidebar, and have different text show up in the widget depending upon the page? Do you want the widget title to remain the same, or would it be different for each page as well?

    Thread Starter WebshopTrombach

    (@webshoptrombach)

    Good morning, yes, different text and different title for each page …

    kind regards, Astrid

    Probably the easiest thing to do is to create as many different text widgets as you need, then use CSS to only display the one you want on a particular page. This might slightly increase the load time, since the page is loading all of the widgets (even though only one is being displayed), but the lag shouldn’t be significant unless you have a lot of widgets or if there’s a lot of content in each of the widgets (like images). If it’s just a few lines of text in each widget, it should be fine.

    A second alternative is to use just one text widget, and because text widgets allow you to include HTML code, add different sections that can be hidden & displayed using CSS. This may also increase the load time slightly, since you are loading all of the widgets’ contents, but not as much as the former option. This is also slightly more complicated as you will need to write some HTML tags (I don’t know your level of expertise).

    Another alternative is to use Javascript to replace the content of the text widget after the page loads. This will be the fastest, but is a bit more complicated if you aren’t familiar with writing Javascript.

    I’m not sure of your level of design expertise. Would you like me to tell/teach you how to do it or would you like me to just give you the CSS rules to use for the first option? If the latter, then please create the widgets that you want to use, post a link to your site, and let me know what widget to display on which page.

    I would recommend using a widget visibility plugin that lets you easily control which pages and posts any given widget appears on – I think that’s probably the simplest route.

    There’s a very good and easy-to-use widget visibility module built into Jetpack.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘customized widget text per page’ is closed to new replies.