Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Why have you chosen to display children of parent by specified by slug?

    Slugs change so isn’t the parent id much more reliable.

    Great plugin!!! It has saved me a lot of work.

    Thanks a lot.

    Please add the feature to display children by parent id. This is the only missing part for my project.

    Thread Starter Muxh

    (@caciocode)

    This is my code:

    function add_my_rule() {
        global $wp;
    	add_rewrite_rule('(.?.+?)/format(/[0-9]+)?/?$','index.php?pagename=$matches[1]&format=$matches[3]','top');
        /*global $wp_rewrite;
        $wp_rewrite->flush_rules();*/
    }
    add_action('init', 'add_my_rule');
    
    function add_custom_page_variables( $public_query_vars ) {
    $public_query_vars[] = 'format';
    $public_query_vars[] = 'pagename';
    
    return $public_query_vars;
    
    } // End add_custom_page_variables()
    add_filter( 'query_vars', 'add_custom_page_variables' );

    I do flush the rewrite rules each time the plugin is enabled with
    flush_rewrite_rules();

    …and the rules seem to be registering fine with WordPress, just not working the way I would like them to.

Viewing 2 replies - 1 through 2 (of 2 total)