Hi Toggle Wideget
-
Hi
I am using https://elementor.com/help/toggle-widget/ and have a shortcode that pulls in child pages using the below as a shortcode ( https://nimb.ws/ghmq6F). This is working fine.
function wpb_list_child_pages() {
global $post;
if ( is_page() && $post->post_parent )
$childpages = wp_list_pages( ‘sort_column=menu_order&title_li=&child_of=’ . $post->post_parent . ‘&echo=0’ );
else
$childpages = wp_list_pages( ‘sort_column=menu_order&title_li=&child_of=’ . $post->ID . ‘&echo=0’ );if ( $childpages ) {
$string = ‘<ul class=”wpb_page_list”>’ . $childpages . ‘‘;
}return $string;
}
add_shortcode(‘wpb_childpages’, ‘wpb_list_child_pages’);`
What I am trying to achive is to hide the toggle widget when there is no list of child pages in <ul class=”wpb_page_list”>.
How can I achive this , i have tries this but no luck. https://nimb.ws/XOxCyF
Thanks for you help.
- The topic ‘Hi Toggle Wideget’ is closed to new replies.