WordPress.org

Ready to get started?Download WordPress

Forums

Gecka Submenu
[resolved] Shortcodes wont work (6 posts)

  1. goodcall
    Member
    Posted 3 years ago #

    Shortcodes is being replaced with nothing.
    no settings work.

  2. Gecka
    Member
    Plugin Author

    Posted 3 years ago #

    Can you explain your setup a bit more?

    Do have defined a custom menu ? What shortcode do you use with witch parmeters?

  3. goodcall
    Member
    Posted 3 years ago #

    I just need to render af bullit list in the current page, og the current page child pages.
    Do you have an explanation on how to get that right?

    /Brian

  4. Gecka
    Member
    Plugin Author

    Posted 3 years ago #

    You should first understand that gecka submenu, can render a list of child items of menu items defined in a custom menu (under appearance > menu)

    If you want to render the child pages of current page just use the wp_list_pages function.

    Something like this could do the trick:

    function gecka_subpages( $atts ) {
    
        $defaults = array('title_li'=> '', 'child_of' => $GLOBALS['post']->ID);
    	$atts = shortcode_atts( $defaults, $atts );
    
        $atts['echo'] = 0;
    
    	return wp_list_pages($atts);
    }
    add_shortcode( 'subpages', 'gecka_subpages' );

    Then use the subpages shortcode using any argument from wp_list_pages documentation page

    --
    Gecka
    We helped you? Say thanks

  5. goodcall
    Member
    Posted 3 years ago #

    Cool thanks.

  6. Gecka
    Member
    Plugin Author

    Posted 3 years ago #

    Did that work for you?

    --
    Gecka
    We helped you? Say thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic