Does this plugin respect Content Permission?
We use WP as an Intranet tool and we hide some pages for some users, so we would like the “Child Page” plugin to not show pages that the user does not have access to.
]]>Modify line 80 of child-page-navigation.php
echo "<li". ($page->ID == $post->ID ? " class='current-page'" : '') ."><a>ID)."'>".get_the_title($page->ID)."</a>";
to get class=”current-class” on the list item element then use display:none in the CSS to hide it.
I would have added here but the topic’s closed.
]]>Hi,
On line 34 in the file child-page-navigation.php there is a typo.
$instance[‘tiutle‘] = apply_filters( ‘widget_title’, $instance[‘title’] );
I guess it should be:
$instance[‘title‘] = apply_filters( …….
Regards, Michiel
]]>I’m so thrilled to find this widget!
But it just won’t work on one of my pages… works on all the others… what am I missing?
https://www.andyssummerplayhouse.org
Should be sub-pages under “news”…
]]>Hello
Is it possible to set the order of the pages. For now it is displayed alphabetic, and I want to choose by setting the order. I tried to set the order of the pages under Pages, but it is not affecting this plug in.
Thank you for your reply.
br
Kjersti Bakke
First of all its a nice module.
Im just missing one thing.
When I have a 3 level menu, and click on the 3 level child, then all of the 2 level childs are getting removed.
Parent
—Child 1
——Child 2
—Child 1
—child 1
When you click Child 2, then the menu looks like this
Parent
——Child 2
Is there are way to fix it ?
]]>Hi,
I have a site https://dev.ussailing.org which is using the child page navigation plugin for the side menu. I like how it works with showing the child menu but is it possible to show no menu when there is no child menu item within that page? For example https://dev.ussailing.org/index.php/membership/benefits/insurance/ its the insurance page and only showing the insurance page on the side menu.
any help appreciated.
]]>Hi awesome plugin. Exactly what I need… almost.
The only thing its missing is a CSS class in the currently LI element for the current page (just like in the standard wp navigation menu). That way I can highlight what child page the visitor is currently viewing.
Thanks!
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Recently updated the plugin and sorting by page order is no longer working. Is there a quick fix I can implement as the site I’m using it on should be live soon?
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Does anyone know how I can change it so the child page navigation title is the parent page name or grandparent page name?
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Hi your plugin was really useful for us. The two items that another user complains about were extremely useful from us
Widget will now show sibling pages if there are no children and there are sibling pages
Default sort order changed to the specified menu order in WordPress
However there is a feature that is missing. The ability to exclude the current page from the list of navigation items. We had to hack it to perform that way:
Here is the code to do it in case you would like to make this a proper option:
— child-page-navigation.orig/child-page-navigation.php 2012-06-27 01:43:42.000000000 +0300
+++ child-page-navigation/child-page-navigation.php 2012-11-20 15:30:00.062651844 +0200
@@ -68,13 +68,15 @@
echo "";
echo $after_widget;
}elseif($post -> post_parent) { // Show the sibling pages if there are no children
- if(count($siblings)) {
+ if(count($siblings) > 1) {
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
echo "
<ul>";
foreach($siblings as $page){
- echo "
<li><a>ID)."'>".get_the_title($page->ID)."</a></li>
";
+ if ($page->ID != get_the_ID()) {
+ echo "
<li><a>ID)."'>".get_the_title($page->ID)."</a></li>
";
+ }
}
echo "</ul>
";
echo $after_widget;
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Widget will now show sibling pages if there are no children and there are sibling pages
Default sort order changed to the specified menu order in WordPress
I think features like these should be optional. Can you provide possibilities to change current behavior, may be by creating the plugin options page in settings?
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Is there a way to limit the number of child pages showing on the side bar. I would like to only show ten, is that possible. Thanks for the information.
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Just curious if there are plans to make it so this supports custom post types any time soon? CPTs I work with often have a hierarchichal structure
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Hi, your plugin is a life-saver in a number of ways, so I am very grateful to you for creating it. That said, I would love to be able to add a class to the current page so that I can highlight it. What do I need to do in order to add that functionality?
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>Good work with your widget. In my case, I needed to display the parent page under some cirumstances, so I made a quick enhancement:
<?php
/*
Plugin Name: Child Page Navigation
Plugin URI: https://www.ads-software.com/extend/plugins/child-page-navigation/
Description: Provides a theme-independent widget to display the child pages of the current page.
Author: ITS Alaska
Author URI: https://ITSCanFixThat.com/
Version: 1.2.1
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
class theme_navigation extends WP_Widget {
function theme_navigation() {
parent::WP_Widget('theme_navigation', 'Child Page Navigation', array('description' => '', 'class' => 'theme-navigation'));
}
function form($instance) {
$default = array( 'title' => __('Navigation'), 'show_parent' => 0 );
$instance = wp_parse_args( (array) $instance, $default );
$field_id = $this->get_field_id('title');
$field_name = $this->get_field_name('title');
echo "\r\n".'<p><label for="'.$field_id.'">'.__('Title').': <input type="text" class="widefat" id="'.$field_id.'" name="'.$field_name.'" value="'.attribute_escape( $instance['title'] ).'" /><label></p>';
echo "\r\n".'<p><input class="checkbox" type="checkbox" value="1" ';
checked( $instance['show_parent'], 1 );
echo ' id="'.$this->get_field_id( 'show_parent' ).'" name="'.$this->get_field_name( 'show_parent' ).'" />
<label for="'.$this->get_field_id( 'show_parent' ).'">Show parent page?</label></p>';
$field_id = $this->get_field_id('page');
}
function update($new_instance, $old_instance) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['show_parent'] = $new_instance['show_parent'];
return $instance;
}
function widget($args, $instance) {
extract($args, EXTR_SKIP);
global $post;
$pages = get_pages(array(
'child_of' => $post->ID,
'parent' => $post->ID,
'sort_column' => 'menu_order'
));
// Chek if Parent should be displayed
$show_parent = isset( $instance['show_parent'] ) ? $instance['show_parent'] : false;
// Check if the current page has a parent
if ($post -> post_parent) {
// Get sibling pages
$siblings = get_pages(array(
'child_of' => $post -> post_parent,
'parent' => $post -> post_parent,
'sort_column' => 'menu_order'
));
}
if(count($pages)){
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
echo "<ul>";
if ( $show_parent == 1){
echo "<li><a href='".get_permalink($page->post_parent)."'>".get_the_title($page->post_parent)."</a></li>";
}
foreach($pages as $page){
echo "<li><a href='".get_permalink($page->ID)."'>".get_the_title($page->ID)."</a></li>";
}
echo "</ul>";
echo $after_widget;
}elseif($post -> post_parent) { // Show the sibling pages if there are no children
if(count($siblings)) {
echo $before_widget;
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
if ( !empty( $title ) ) { echo $before_title . $title . $after_title; }
echo "<ul>";
if ( $show_parent == 1){
echo "<li><a href='".get_permalink($post -> post_parent)."'>".get_the_title($post -> post_parent)."</a></li>";
}
foreach($siblings as $page){
echo "<li><a href='".get_permalink($page->ID)."'>".get_the_title($page->ID)."</a></li>";
}
echo "</ul>";
echo $after_widget;
}
}
}
}
function register_theme_navigation_widget(){
register_widget('theme_navigation');
}
add_action('widgets_init','register_theme_navigation_widget');
?>
Just in case someone could make use of this.
]]>Sounds useful. Could you please add a screenshot so we can see what this plugin looks like in action?
https://www.ads-software.com/extend/plugins/child-page-navigation/
]]>