I have a website issue I am trying to resolve
I have a website issue I am trying to resolve
I have a website issue I am trying to resolve
I tested this as a function. You can place it in your footer or functions.php theme file and call it in your themes footer section. See the comments for links to the functions used. function wpse_101774_footer() { // Start this part of footer on new line. echo “\n”; foreach ( array( 14, 19 ) as … Read more
Just change the ‘child_of’ => $post->ID argument to ‘child_of’ => 61, or whatever the ID of the parent page is.
I do this quite often, actually, if I’m understanding your issue correctly. If you use Appearance > menus, and create your navigation (with dropdown/children), then pull in the Custom Menu widget into the sidebar, you can use CSS to handle the rest. Basically, you just set the main navigation in the header to how the … Read more
If I’m understainding you correctly, you’ve hardcoded the wp_list_pages() function in to the widgetized area of the theme’s sidebar, and then, when you add a widget using WordPress’ back end Appearance->Widgets then you no longer see the output of the wp_list_pages() function? If that’s the case, then I think we’ve found your problem. If code … Read more
You need to look at get_ancestors() to get the top level parent of a page. Just a note, for reliability, use get_queried_object() (or even better $GLOBALS[‘wp_the_query’]->get_queried_object()) to get the current post/page object on singular pages, $post can be quite unreliable You can try the following in your shortcode: $post = $GLOBALS[‘wp_the_query’]->get_queried_object(); // Make sure the … Read more
Previous Question That answer I’ve linked to shows the steps you’ll need to take. It probably didn’t come up in your searches as you weren’t using the right terms. As you’re a front-end dev, this is how I’d do it based on that persons advice. Don’t load anything in the template. Just have an empty … Read more
I made this by jQuery: $(‘.sidebar-list li a’).filter(function(){ return this.href === location.href; }).addClass(‘active’);
Maybe array_slice($subpages, 0,5) to cut the array after 5 entries?
If I understand your question correctly, you try to just get the children and ignore the parent. Dont know where post_child => 0 comes from but I’d use post_parent => $parent_id instead. In that case you have to catch the parent ID before you do any new queries. If you do something like this at … Read more