I am working on a blog at www.tosreport.com/scripting and might want to adjust where I place certain items such as the shoutbox plug-in on the right hand side of the page. Apparently, the only 'widget areas' are sidebar and footer. Is it possible to place a widget in the body of a page or even in the body of a particular post?
Of course, you just have to register another sidebar widget area:
http://codex.wordpress.org/Function_Reference/register_sidebar
And then, place on index.php or loop.php depends on your theme layout:
Check this code, this is an example of what you need, placing the previous code in the "ad" code:
https://stackoverflow.com/a/7001372/1478479
Related
I have a main menu which has multiple sub-menus. Some of the sub-menus are created based on some product categories. So there is no page exist which is directly associated with this sub-menu item. Once we select a sub-menu, it actually display all the products belongs to the category.
Problem is that the sidebar is always displayed on the left side of the page. But I want to show it on the right side of the page. Since there is no page associated with the product category, I don't know which page to modify to change the sidebar position.
I am using OceanWp theme.
I was suffering from the same problem as you and couldn't find a solution. I'm using an OceanWp theme as well. I added this in the Custom CSS/JS section in the customize window:
var body = document.getElementsByTagName("BODY")[0];
body.classList.remove("content-left-sidebar");
body.classList.add("content-right-sidebar");
Pages with sidebars active have the class has-sidebar in its <body />'s classlist, while pages without sidebars do not contain that class. This means that this code snippet will not any affect pages without sidebars enabled.
I am using woocommerce for the first time and have searched for answers to this question for hours now. Found none. I'm exhausted and really grateful if someone wishes to help out.
I am using woocommerce on a self-created child theme. The main shop page uses a theme-template called "page-left-sidebar", which normally places the sidebar with widgets to the left of the page. This option would look good in the web shop that I'm trying to create.
But Woocommerce templates override my custom templates, and although I get the correct "page-left-sidebar"-template's sidebar widgets, I see with my eyes and also when investigating with firebug, that woocommerce is calling the "page-right-sidebar"-template's main & sidebar css rules instead those of the left-sidebar-template. The page-right-sidebar is the default page template in my theme, as it happens.
I have tried editing woocommerce's "archive-product.php" -page. But I just cannot understand, where and how to tell the div's to be situated where I want them to.
My theme's default "page.php" and "page-left-sidebar.php"-template are identical. Only the template's name (obviously) changes. In my "style.css" I have rules both for default sidebar (sidebar to the right) and page-left-template-sidebar.
What files should I edit and how?
To display sidebar on the left, the style.css file should have property float:left for that section
Found a workaround... I still don't understand how the default templates work, but I've tried until I give up. I just hard-coded a div style="right;" in the archive-product.php, closing the div just before the sidebar commanding lines. It's crude, I know, but it seems to do the trick.
I am thinking of adding a small full width and 200px height a div which contain some random post(it will be just random choosen by wordpress), done by me with image and a small <20 words post title.
How can i do this, is there any plugin for it.
After researching and trying i am not getting anything.
Can some one help me here?
1) Go to widget menu..
2) Add the widget to the home sidebar
http://wordpress.org/plugins/spider-random-post/
3) Edit the index.php code and call the home sidebar to header.php file. (It will remain on all pages).
edit the code and css as per your requirement.
I am new to wordpress and I am trying to figure out how menus relate to widgets. Is there a way I can add a widget to a page? Not on the side bar but in the page.
Not easily, I'm afraid :( However, a 'sidebar' in WordPress can be any container in your website. It does not necessarily need to be on the side of your page. You can use register_sidebar() in your functions.php file to create a new sidebar, then simply display the widgets in your new sidebar with dynamic_sidebar(). It's your CSS that places the sidebar on the side of your page. If you look at it that way, you can instead use CSS to make a horizontal 'sidebar' for instance. The name 'sidebar' will most likely change at some point in the future to better reflect that.
I'm making a Wordpress 2.9.2 theme, and I'd like each page to have its own sidebar than can be edited as easily as the page's content. It would be cumbersome to make a different template file for each sidebar. It would also be weird to add a "custom field" containing all the sidebar text, since I wouldn't be able to use the Visual/HTML editor. What I'd like is to have a tag similar to the tag, but instead of delimiting the content to be shown on the front page, it would split the post's content and sidebar. Is this possible? Or is there a better solution?
Make the sidebars widgetized and than use the widget logic plugin, so you can conditionally include widgets on any and all pages.
Doing this lets you utilize the out of the box widgets, which are awesome, and even integrated third party widgets that are just as great.
Also consider this: You widgetize other areas of your site, like your header, which can now use widgets and widget logic. This makes for a more flexible theme.