Tag Info

New answers tagged

1

Try this - I've not implemented it fully, but I have tested it and it seems to work. Place it in your functions.php and call <?php list_child_pages(); ?> in your template or use the shortcode [childpages] in your editor. <?php // List Child pages of a parent. function list_child_pages() { global $post; if ( is_page() && ...


0

I think there is a 'more reliable' option. Relying on the menu item number is not garanteed to work if you migrate your code from development to production for example. If you turn the number into a setting it is getting better, but still not really good. An alternative could be to link to a non-existent anchor, like #olark, from your menu-item. This can be ...


0

Single pages are designed to display a single post, and not an index of posts as an archive page would. I'm not really sure what are you trying to achieve here as well. It is always a bad idea to try and use a specific template for anything else than what it was intended for. The main query are quite specific to a specific template, in this case, the main ...


0

If you call wp_list_categories, and add the parameter 'show_count'=> 1, it will return the number of posts in each category, inside parentheses. Regarding getting a date evaluation, you might want to use the date parameters in WP_Query.


0

In addition to Rarst's and Chip's answers above, register_nav_menu is used in this in manner: register_nav_menu( $location, $description ) What you've specified as primary_nav and secondary_nav are actually menu location identifiers and not the actual menu identifiers. That is why you have to use theme_location in your wp_nav_menu arguments instead of menu ...


-1

You can customize previous_post_link like this previous_post_link('%link','<img src="link_to_image"/>');


1

After reading PHP and wordpress codex i achieved what i wanted, by making a walker class. Here is the code class Hambos_Walker_Nav_Menu extends Walker_Nav_Menu { function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat("\t", $depth); if ($depth == 0): $output .= "\n$indent <div>\n"; ...


1

Your data model is interesting. You can answer this question better than me, but I don't know if we really can say, as @toscho does, that a lesson will never be shared between courses, or that no two levels will have the same lesson in. I believe that a lesson and a course are both post-like things, but a level is something that makes less sense on its own ...



Top 50 recent answers are included