jonoc73
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Display an include from a Custom Field ValueOk, I have a custom fields key of gt_guides and there are a list of checkboxes for the staff giving values of Phil Rob Nic and Jef etc. Each has their own php file with a div and some contact info like this:
<div id="guidewrap"> <div class="guide"><a href="https://www.website.com/guides/phil"><img src="/images/guides/phil.png"/></a></div> <div class="details"><a href="https://www.website.com/guides/phil">Phil</a></div> <div class="contact">Email: <a href="mailto:[email protected]" title="Email">[email protected]</a></div>
I want to display the div containing their contact details if their name is selected in the checkbox. If their name isn’t checked then I don’t want anything to show.
The above code does word but I was wanting to know what I should remove from it as it was originally written to echo a list of names like Phil, Rob, Nic instead of including a php file.
Thanks Jono.
Forum: Fixing WordPress
In reply to: Display an include from a Custom Field ValueSorry guys, yes I should have written more to explain!
At the moment the above script was written to display guide names if they were filled in in a custom field. They would display like: John, Kev, Peter
Instead of just their name I wanted to display a div containing things like a small images, email and phone details – this was via the TEMPLATEPATH line.
However I am still using the same code as if they were a list of names including the ‘comma’ between them.
So what would I take out of the above code?
Thanks for your help once more.
Jono.
Forum: Fixing WordPress
In reply to: Help! My Breadcrumbs are all messed upI have figured it out – I need to put the breadcrumb in the loop.
Forum: Fixing WordPress
In reply to: Display an include from a Custom Field ValueWhat would I take out if I didn’t want a comma’ed list? I just wanted a list of the included templates?
Thanks J
Forum: Fixing WordPress
In reply to: Displaying Custom Field checkboxI took a look at the code again and it’s simple really isn’t it!
I replace
if ('John' == $guide ) {$out .= $guide . ' is a man' . $between;}
with
if ('John' == $guide ) {include(TEMPLATEPATH . '/guides/john.php'); }
Thanks for your help.
Jonathan
Forum: Fixing WordPress
In reply to: Displaying Custom Field checkboxMichael, You’re helping loads – thanks once again.
When I asked if I was able to do something with each value I meant doing something like including a template path for example.
I should have explained it more sorry.
If the value is John I want to include a template where I can include his photo, contact info etc.
<?php } else { include(TEMPLATEPATH . '/guides/john.php'); } ?>
If the value includes Mary I want to include a template where I can include her photo, contact info etc.
<?php } else { include(TEMPLATEPATH . '/guides/mary.php'); } ?>
Thanks for your help so far – it’s been great.
Jonathan
Forum: Fixing WordPress
In reply to: Displaying Custom Field checkboxThat’s great – thanks for your help it works, but it’s not too pretty though. How would I add a space and a comma into the code to get something like: John, Ben, Claire
Also am I able to do something with each value. Say I used the if statement shown in the first post above, if the value is John do this and if the value is Ben do that?
Thanks Jonathan
Forum: Fixing WordPress
In reply to: Displaying Custom Field checkboxThanks Michael, I have probably done this wrong, but put the above into the code and it just returns the word Array instead of the tour guides names.
<?php $single=false; echo get_post_meta($post->ID, "guides", $single); ?>
Thanks Jono.
Forum: Fixing WordPress
In reply to: Custom Field Date to display as words.Thanks stwlf but how should I add the F j, Y string into the above code? I assume I add it to the echo line but have tried all sorts of combinations but can’t get it to work??