Font change in Address Array

This topic contains 8 replies, has 3 voices, and was last updated by  surfeinheit 11 years, 9 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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

    zabbyh
    #2809

    Hey 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 [.

    surfeinheit
    #2812

    Thanks Konrad!

    The forums have now been updated so that HTML is no longer swallowed. Sorry for the inconvenience!

    Stephen Harris
    #2814

    Here in correct syntax =)`, thanks Stephen

    $address = array_filter(eo_get_venue_address($venue_id));
    echo '<span style="font-size:12pt">'.implode(‘, ‘,$address).'</span>';

    Konrad

    surfeinheit
    #2816

    Hi 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;
    ?>

    zabbyh
    #2817

    Sorry 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.

    zabbyh
    #2819

    Hi 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 Harris
    #2824

    Hi 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…

    zabbyh
    #2825

    Hey 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
Viewing 9 posts - 1 through 9 (of 9 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.