How to customize navigation menu?

Using wp_nav_menu() and a Walker is a great thing and I really appreciate the other answers with this solution, but I think it’s a really hard way to go for a simple menu. So I found myself quite often doing it via wp_get_nav_menu_items() So let’s focus on the idea: I just get all the menu … Read more

Get string from array and start loop [closed]

Interesting! Looking at the bp_group_has_members it allows to to pass only single group using the group_id parameter when my first thought was that it would be able to pass an array of groups. using your method you will need to run the loop multiple times in order to get the results you want. What i’d … Read more

Fake Single WordPress Post (Page) Loop

How about something like this instead: add_action(‘template_redirect’, function(){ get_header(); echo ‘page stuff’; get_footer(); exit(); }); add_filter(‘the_title’, function(){ return “Virtual Page Title”; }); What you are trying to do strikes me as very prone to error. Different themes can do all kinds of different things with page.php, not to mention that it may not be present … Read more

Shortcoding with Divs

This should do the trick: http://codex.wordpress.org/Shortcode_API#Output Copying verbatim from the documentation: function myShortCode() { ob_start(); ?> <HTML> <here> … <?PHP return ob_get_clean(); } Basically what happens is that all your HTML will not be output, but rather stored in an “output buffer”, and returned by the function.

How to devide post into more than one page using ?

The function you’re looking for is wp_link_pages(). Default usage below: wp_link_pages( array( ‘before’ => ‘<p>’ . __(‘Pages:’), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, ‘next_or_number’ => ‘number’, ‘nextpagelink’ => __(‘Next page’), ‘previouspagelink’ => __(‘Previous page’), ‘pagelink’ => ‘%’, ‘echo’ => 1 ) ) You can read the documentation here: http://codex.wordpress.org/Function_Reference/wp_link_pages