CheckboxControl does not visible change

Solution found: const { __ } = wp.i18n; const { useSelect, useDispatch } = wp.data; const { PluginDocumentSettingPanel } = wp.editPost; const { CheckboxControl, PanelRow } = wp.components; const Sidebar = () => { const { postMeta } = useSelect( ( select ) => { return { postMeta: select( ‘core/editor’ ).getEditedPostAttribute( ‘meta’ ), }; } … Read more

Display posts from category in post content?

You can do this with a query <ul> <?php global $post; $args = array( ‘posts_per_page’ => 5, ‘offset’=> 1, ‘category’ => 1 ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <li><a href=”https://wordpress.stackexchange.com/questions/6376/<?php the_permalink(); ?>”><?php the_title(); ?></a></li> <?php endforeach; ?> </ul> source You can put that in your category page … Read more

Different widgets in sidebar on sub-children pages?

I use Widget Logic at my blog. It is not most convenient solution around, but definitely one of the most flexible. Widgets can be displayed/hidden based on arbitrary PHP condition. Works great with conditional tags and when that is not enough you just write your own conditions and use them.

Filter Text from sidebar widget?

In the method “widget” look for the line that sets the category then add either: $cat = empty($instance[‘cat’]) ? ‘N/A’ : $instance[‘cat’]; (where you replace N/A with something you like) or… better… add a filter instead like this: $cat = apply_filters( ‘widget_my_cat’, empty($instance[‘cat’]) ? ‘N/A’ : $instance[‘cat’], $instance, $this->id_base); And then hook into ‘widget_my_cat’ to … Read more

Widget’s container?

It’s the default behavior of a dynamic sidebar to output li tags around widgets. You can override that though in the sidebar declaration. You would do that by passing the sidebar registration the following additional arguments: register_sidebar( array( ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’, ‘after_widget’ => “</div>” ) );

Is there a simple way to have a new sidebar for each page?

Registering sidebar is just a function call, there is no reason it can’t be run on top of some logic. Here is code I wrote (and use) in my current theme: $pages = get_pages(); foreach ( $pages as $page ) { register_sidebar( array( ‘name’ => “Page: {$page->post_title}”, ‘id’ => “sidebar-page-{$page->post_name}”, ‘description’ => “Widgetized area after … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)