Template Loop – add switch case php

if ( $query->have_posts() ) : ?> <ul id=”list-con”> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php switch ( get_post_type( $post->ID ) ) { case “firstcase”: ?> <li>code as defined above</li> <?php break; case “secondcase”: ?> <li>another code as defined above</li> <?php break; } ?> <?php endwhile; ?> </ul> <?php endif;

How do VLANs work?

Virtual LANs (VLANs) are an abstraction to permit a single physical network to emulate the functionality of multiple parallel physical networks. This is handy because there may be situations where you need the functionality of multiple parallel physical networks but you’d rather not spend the money on buying parallel hardware. I’ll be speaking about Ethernet … Read more

switch combined with if statement

You do not need to use pass the $value in a switch statement, Just pass there $user->roles[0] instead of $value and after that your condition. Add below code and let me know your answer towards it. add_action( ‘um_members_just_after_name’, ‘my_members_after_user_name’, 10, 1 ); function my_members_after_user_name( $user_id ) { $user = new WP_User( $user_id ); /* if( … Read more

WordPress Menu Exchange On Tablet’s Orientation

cybmeta is right you cannot trust server-side browser detection <div class=”portrait”> wp_nav_menu( array(‘menu’ => ‘primary’ ) ); </div> <div class=”mobile”> wp_nav_menu( array(‘menu’ => ‘mobile’ ) ); </div> <div class=”primary”> wp_nav_menu( array(‘menu’ => ‘primary’ ) ); </div> and use media queries to hide and display menu

add_action() in switch statement

Not quite sure what you’re after – something like this? <?php echo apply_filters( ‘basey_page_title_news’, __( ‘<h1>News</h1>’, ‘basey’ ) ) ?> <?php while ( have_posts() ) : the_post(); switch ( true ) : case has_action( “basey_loop_single_$post->post_type” ) : do_action( “basey_loop_single_$post->post_type”, $post ); break; default : ?> <!– your fallback code –> <?php endswitch; endwhile; ?> If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)