exclude pages in custom menu

You probably want to explode your list of page ID’s using the explode function. Something like; <?php $exmenuitems = explode(“,”,get_option(‘exmenuitems’)); $recentPosts = new WP_Query(); $recentPosts->query (array ( ‘post__not_in’ => $exmenuitems, ‘post_type’ => ‘page’, ‘showposts’ => $menuitems )); I’d recommend using the WordPress Menu building functions and admin interface. Its much more intuitive for end users … Read more

category__not_in and id values from variable

get_category_by_slug() returns a category object or FALSE: $cat1 = get_category_by_slug( ‘cata’ ); print ‘<pre>’ . htmlspecialchars( print_r( $cat1, TRUE ) ) . ‘</pre>’; Result: stdClass Object ( [term_id] => 3 [name] => Cat A [slug] => cata [term_group] => 0 [term_taxonomy_id] => 3 [taxonomy] => category category__not_in and id values from variable => [parent] => … Read more

Specific html within wordpress loop

Use rewind_posts() to reset a loop and run it multiple times: <?php $my_query = new WP_Query(‘cat=49&showposts=4&orderby=RAND’); ?> <div id=”carousel”> <?php while ($my_query->have_posts()) : $my_query->the_post(); // output each slide endwhile; ?> </div> <?php $my_query->rewind_posts(); ?> <ul id=”carousel-descriptions”> <?php while ($my_query->have_posts()) : $my_query->the_post(); // output each desc endwhile; ?> </ul> <?php $my_query->rewind_posts(); // etc.