Tag Info

New answers tagged

0

The following worked for me. functions.php function add_query_vars_filter( $vars ){ $vars[] = "ref"; return $vars; } custom template <?php if($_GET['ref'] == 'special') :?> //do something <?php else: ?> //do something <?php endif ;?>


0

a $_GET variable would be the better option. try var_dump($_GET); on the page before the conditional and see exactly what you need to test against It seems that there is something more to the puzzle that we are missing. Is the file not showing up correctly? Could that be because the file paths are wrong? Or is it always showing the wrong image? Also, I ...


0

You need to be able to edit the theme itself (or as a child theme) to make that change - obviously the theme options aren't giving you that option. Chances are that in your header.php or similar you are going to find code that pulls those values from the Theme Options page. That's what you need to edit. When you find that code, you'll want to do a ...


0

Ok I managed to fix this. Posting the answer here for anyone interested. I didn't quite understand that register_nav_menus only registeres menu locations. This is the code I used which does conditionally use different named menus in the same location. For this to work, you have to use the exact name specified when creating the menus. Or, as I did, create ...


0

you can try this: if(get_field('activity_rating') == "1") { echo 'path/to/image/onestar.jpg'; } elseif (get_field('activity_rating') == "2") { echo 'path/to/image/twostar.jpg'; } elseif (get_field('activity_rating') == "3") { echo 'path/to/image/threestar.jpg'; } elseif (get_field('activity_rating') == "4") { ...



Top 50 recent answers are included