Font change in Address Array
WordPress Event Management, Calendars & Registration › Forums › General Question › Font change in Address Array
This topic contains 8 replies, has 3 voices, and was last updated by surfeinheit 11 years, 9 months ago.
-
AuthorPosts
-
December 24, 2012 at 11:48 pm #2808
Hi
I am not sure how to do this, please can you let me know how I could increase the text size of the venue address when it is output using the following code:
$address = array_filter(eo_get_venue_address($venue_id));
echo implode(‘, ‘,$address);Thanks
Zab
zabbyhDecember 25, 2012 at 11:47 am #2809Hey Zab,
I don’t know If I get your problem right, but I simply would use this:
$address = array_filter(eo_get_venue_address($venue_id)); echo '<span style="font-size:12pt"]>.implode(‘, ‘,$address).'<span>';
I cant do a less than or “more than” sign, because my post will be not shown correctly here. So you have to replace the “[” with a “less than” and the “]” with “more than”. Sorry for this.
Konrad
Edit: Edited to use
<
rather than[
.surfeinheitDecember 26, 2012 at 5:59 pm #2812Thanks Konrad!
The forums have now been updated so that HTML is no longer swallowed. Sorry for the inconvenience!
Stephen HarrisDecember 26, 2012 at 6:14 pm #2814Here in correct syntax =)`, thanks Stephen
$address = array_filter(eo_get_venue_address($venue_id));
echo '<span style="font-size:12pt">'.implode(‘, ‘,$address).'</span>';Konrad
surfeinheitDecember 27, 2012 at 11:39 pm #2816Hi Konrad
Thanks for your help, the code you have provided as is, and with changes does not work for me, it comes up with < syntax errors. This is the completes code for the .php template
/*
Template Name: Venue Test
*/
?>term_id;
printf(”, $venue_id );
/* Display venue name and address */
echo ”;
printf(‘ %s ‘, eo_get_venue_name($venue_id) );$address = array_filter(eo_get_venue_address($venue_id));
echo implode(‘, ‘,$address);
echo ”;
/* Display venue description & map */
echo ”;
echo eo_get_venue_description($venue_id);
echo eo_get_venue_map($venue_id);
echo”;
echo”;
endforeach;
endif;
?>
zabbyhDecember 27, 2012 at 11:41 pm #2817Sorry complete code:
<?php /* Template Name: Venue Test */ ?> <?php get_header(); ?> <?php global $woo_options; ?> <div id="content" class="col-full"> <div id="main" class="col-left"> <?php $venues = eo_get_venues(); if( $venues ): foreach( $venues as $venue ): //IMPORTANT: Make sure venue ID is an integer (If its a string, it will be interpreted as a slug). $venue_id = (int) $venue->term_id; printf('<article id="venue-%d">', $venue_id ); /* Display venue name and address */ echo '<header class="entry-header">'; printf('<h1 class="tumblog-title"> %s </h1>', eo_get_venue_name($venue_id) ); $address = array_filter(eo_get_venue_address($venue_id)); echo implode(', ',$address); echo '</header>'; /* Display venue description & map */ echo '<div class="entry-content">'; echo eo_get_venue_description($venue_id); echo eo_get_venue_map($venue_id); echo'</div>'; echo'</article>'; endforeach; endif; ?> </div><!-- #content --> <?php get_sidebar(); ?> </div><!-- #primary --> <?php get_footer(); ?>
Edit: Tidied up code block.
zabbyhDecember 28, 2012 at 12:10 pm #2819Hi zabbyh,
I tidied up your code bit – if you want to post code blocks, then leave a line blank and indent all code by at least by 5 spaces. Bactics are intended for in-line code. (You may have done that and the forums is to blame…).
The above works for me without any problems. All you need to do is replace,
echo implode(‘, ‘,$address);
with
echo '<span style="font-size:12pt">'.implode(', ',$address).'</span>';
All the best,
Stephen
Stephen HarrisDecember 31, 2012 at 10:40 pm #2824Hi Stephen
Thanks, that is working fine now, can you tell me how I would enter a new line within this code after the address and before the google map is shown, so there is some white space
Thanks…
zabbyhJanuary 1, 2013 at 7:19 pm #2825Hey Zabbyh,
There is the question: Would you like to have a line between the address and the venue description or a line between the venue description and the map?
Your template has the structure to display the address – than the venue description – then the map.First solution – a line between Address and Item description:
Replace,
echo '<span style="font-size:12pt">'.implode(', ',$address).'</span>';
with
echo '<span style="font-size:12pt">'.implode(', ',$address).'</span><p></p>';
Second solution – a line between Item description and the map:
Replace,
/* Display venue description & map */
echo '<div class="entry-content">';
echo eo_get_venue_description($venue_id);
echo eo_get_venue_map($venue_id);
echo'</div>';
with
/* Display venue description & map */
echo '<div class="entry-content">';
echo eo_get_venue_description($venue_id);
echo '<p></p>';
echo eo_get_venue_map($venue_id);
echo'</div>';
If you want to have both lines between, simply replace both pieces of code.
Greets, Konrad
surfeinheit -
AuthorPosts