Do you actually want to add a widget to the post content area? (Not possible, AFAIK.)
Or, do you want to add different widgets to widget areas, depending on the page/post someone is looking at it? In that case, the Widget Logic plugin may be what you are looking for:
https://wordpress.org/plugins/widget-logic/
Or, do you want to add different code to different posts (again, in the post content area)? In that case, try using a shortcode plugin:
https://wordpress.org/plugins/search.php?type=term&q=shortcode
If none of the above, please advise.
I wanted to add a widget to the post content area, So that I can have this to code appear at the end of my post.
<!– SHOPSTYLE COLLECTIVE WIDGET CODE START –> <div class=”shopsense-widget” data-options=”%7B%22widgetId%22%3A%2256bbcdd14df128828fe9717a%22%2C%22version%22%3A1%2C%22pid%22%3A%22uid6081-32927991-95%22%2C%22size%22%3A265%2C%22columns%22%3A3%2C%22rows%22%3A1%2C%22url%22%3A%22https%3A%2F%2Fapi.shopstyle.com%2Fapi%2Fv2%22%7D”><script> !function(doc,s,id){ var e, p; if(!doc.getElementById(id)) { e = doc.createElement(s); e.id = id; p = ‘//shopsensewidget.shopstyle.com/widget-script.js’; var cb = new Date().getTime(); p += ‘?cb=’ + cb; e.src = p; doc.body.appendChild(e); } if(typeof window.ss_shopsense === ‘object’){ if(doc.readyState === ‘complete’){ window.ss_shopsense.init(); } } }(document, ‘script’, ‘shopsensewidget-script’); </script> <iframe src=”//shopsensewidget.shopstyle.com/#/?options=%7B%22widgetId%22%3A%2256bbcdd14df128828fe9717a%22%2C%22version%22%3A1%2C%22pid%22%3A%22uid6081-32927991-95%22%2C%22size%22%3A265%2C%22columns%22%3A3%2C%22rows%22%3A1%2C%22url%22%3A%22https%3A%2F%2Fapi.shopstyle.com%2Fapi%2Fv2%22%7D” height=”340px” width=”900px” seamless style=”border: 0;”></iframe></div> <!– SHOPSTYLE COLLECTIVE WIDGET CODE END –>
Moderator
t-p
(@t-p)
http://codex.wordpress.org/Widgetizing_Themes
You can use this approach to widgetize any template.
For example, edit the theme template file, and wherever you want the widget section to be, put the following lines:
<?php if (!dynamic_sidebar('some name for this widgets section') ) : ?>
<?php endif; ?>
Then, in your theme’s functions.php file, put the following:
register_sidebar(array('name' => 'some name for this widgets section'));
Yes, but do it in a child theme!
Hi guys, not sure if I should start a separate thread for this but I am using the same SHOPSTYLE COLLECTIVE WIDGET CODE as chynna21. I currently have this code inside each of posts which displays a product carousel nicely in the post. But I am looking to have the product carousel on my front page under the excerpt of the post also. Any ideas? Thanks 🙂