We are using the WP-Brightly theme, a child of WP-Prosperity.
Thank you,
Lili Francklyn
I am trying to design an elegant method to display post-specific contents into the sidebar.
Inspired by this thread, which ask the same question, I adapted the nice general solution of this thread to query custom fields and display them in the left sidebar area.
add_action( '__before_left_sidebar', 'du_rock_box' );
function du_rock_box() {
if ( is_singular( 'post') ) {
$rock = get_post_meta( get_the_ID(), 'du_rock', true );
if( ! empty( $rock ) ) {
echo '<div class="widget_area">'. '<p style="font-size:24px; color:#0000FF;">du Rock</p>' .'</div>';
echo '<div class="widget_area">'. $rock .'</div>';
}
}
}
add_action( '__before_left_sidebar', 'des_carottes_box' );
function des_carottes_box() {
if ( is_singular( 'post') ) {
$carottes = get_post_meta( get_the_ID(), 'des_carottes', true );
if( ! empty( $carottes ) ) {
echo '<div class="widget_area">'. '<p style="font-size:24px; color:#FF3333;">des Carottes</p>' .'</div>';
echo '<div class="widget_area">'. $carottes .'</div>';
}
}
}
https://www.hostingpics.net/viewer.php?id=824582Capturede769cran20160817a768013850.png”
I like this solution because it allows to keep the content of the text boxes in the relevant post (contrary to multiplying custom widgets with the custom sidebars plugin)
This is only a proof of concept and I need to be able to further customize the boxes. I have several questions :
– How do I get the handles of what I have created ? Ideally, I’d like to have two separate text boxes, one for each custom field, and be able to customize them with a specific border, layout, etc.
For example, I have tried to shift the text down a bit so that it sits below the title of the post, but
.left.tc-sidebar {
margin-top: 110px;
}
does not work. I conclude that left.tc-sidebar is not the correct handle for my object ?
– Is it possible to add a logo at the top of each text box ? Intuitively, I feel that I am missing a step. My basic understanding of php language tells me that I have just printed some string in the widget area of the left sidebar. So I don’t even have two individual “text widgets” to start with.
Would anyone have suggestions to head into this direction, and possibly php code snippets ?
Thanks in advance,
Benjamin
]]>The problem occurs when I use is_active_sidebar() to test and it returns true, and the user hasn’t created a custom menu widget (only other widgets), so there needs to be a wp_list_pages() if there isn’t a custom menu widget, or some other function to create a default navigation.
Suggestions?
]]>For example within Math Category, I have subcategories for
Algebra and Geometry
and then withing Algebra and Geometry there are more subcategories. I guess this hierarchy can help you visualize.
– Math
— Algebra
— Equations
— Quadratic Equations – Blog post 1
— Quadratic Equations – Blog post 2
— Roots
— Functions
— Geometry
— Circles
— Triangles
— Right Triangle
— Perfect Triangle
What I would like to do is this:
If I am on the Equations page – I would like to see all the title of blog posts related to equations in a sidebar.
If I am on the Triangles page – I would like to see a sidebar with all the child posts marked as triangle subcategory.
If I am a level higher let’s say at Algebra page, then my side bar should show child topic of Algebra only one level deep:
— Equations
— Roots
— Functions
Look forward to any guidance that the kind folks here can provide. Thanks
]]>I have a website using the Bare Premium Theme.
It’s a woo commerce theme advertised for clothing although can be used for any commerce.
My sidebar in the center area where the posts go doesn’t have any css coding to even change the width and I can’t recall where to even insert it.
I need my sidebar to be full width in the mid-gray section which might be called the articles portion.
Yet every coding I try doesn’t work. I installed a store slider to show products and wanted it to slide through the center of my site even if there is a store link just to show some top 10 products.
Need Help asap please because of online store opening soon.
this is my style page
‘/*
Theme Name: Bare
Description: Bare is a beautifully clean, responsive ecommerce theme for WordPress.
Tags: responsive-layout, custom-menu, post-formats, theme-options, threaded-comments, translation-ready
Author: LoveThemes
Author URI: https://lovethem.es
Theme URI: https://demo.lovethem.es/bare
License: GPL
License URI: https://demo.lovethem.es/bare
Version: 105
*/
@import url(“assets/css/minified.css.php”);
‘
and this is my sidebar css.
‘<aside id=”aside” class=”inline”>
<?php if( ! function_exists( ‘dynamic_sidebar’ ) || ! dynamic_sidebar( ‘Sidebar Widgets’ ) ) : ?>
<?php // widgets load here ?>
<?php endif; ?>
</aside>’
and my website is pureinconline.com
Thanks so much for any help.
]]>www.lyndammay.com
]]>I have a problem with my cart widget in my sidebar.
WP Super Cache is caching the whole page including the sidebar so even when adding items to the cart, the cart widget in the sidebar displays 0 items.
How do I prevent the sidebar caching? I read something about mfunc or something like that.
Can someone tell me what is the code and where to implement it?
Thank You!
https://www.ads-software.com/plugins/wp-super-cache/
]]>On my previous theme, I had the postlinks hard-coded in php onto the sidebar. It worked perfectly:
<!-- start random post links -->
<h2><?php _e('5 randomly chosen posts:'); ?></h2>
<ul>
<?php
// omit posts from categories 4, 6, 8
$args = array( 'posts_per_page' => 5, 'orderby' => 'rand', 'category__not_in' => array(4, 6, 8) );
$rand_posts = get_posts( $args );
foreach( $rand_posts as $post ) : ?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<!-- end random post links -->
But with this new child theme, I have a dynamic sidebar so cannot use a text widget and add the coding that way. It appears that the text widget will not permit php coding.
With only enough knowledge about coding to get myself in trouble, I’m guessing that if I put the required code into the child’s functions file. But from there, I’m stymied.
I’ve looked for a random posts plugin but do not see one that will omit categories and/or is compatible with the latest version of WP.
Thank you for any help you can offer.
E Morris, etherwork [dot] net [slash] blog <- please leave unlinked to help prevent malicious bots from visiting
]]>This topic, I need help to make the widgets / new dynamic sidebars to appear side by side (2 columns). I did 3 “dynamic sidebars” before, as you can see Announcement and Agenda in home page, while Comment Policy appear in every single page after my post.
My sample page
My sidebars setup
My new dynamic sidebars:
a) Home 1 (Sidebar ID: home1)
b) Home 2 (Sidebar ID: home2)
Link to my site: blog.adiazudin.com
]]>I’d like to change the order of the maps depending on what category the user is looking at.
So If the user is looking at Scotland or England & Wales the first map to the right would be England, Scotland, Wales
And if the visitor is looking at the Australia & New Zealand category, the top menu would be the map of Australia and New Zealand.
How can I achieve this?
]]>