Posted: July 19, 2016 at 11:54 am
|
Currently when I use your shortcode [ESPRESSO_VENUE id=”1″] the city, state and zip appears on a separate lines. Is it possible to have them appear on one line? |
Hi there, To confirm, your using EE3 correct? To do that with EE3 you would need to create you own custom function to output the replace the function used to output the details. You can then format the venue information however you prefer when output. You can use the Custom Files Add-on to add your own ‘espresso_venue_details_sc’ function that could override the default function. How comfortable are you with PHP? |
|
Actually it may also be possible to use some CSS to work around this, can you link me to where you are currently using that shortcode? I’ll see if I can find some CSS for that page. |
|
|
|
This should work, although not in all browsers. Using your own custom PHP function would be the preferred method but you can try this: /* Set the br tags content to a space /* .event_venue .venue_details br:nth-of-type(2), .event_venue .venue_details br:nth-of-type(3) { content: ' '; } /* Add a comma after the BR tag */ .event_venue .venue_details br:nth-of-type(2)::after, .event_venue .venue_details br:nth-of-type(3)::after { content: ', '; } We recommend using either the My Custom CSS or Reaktiv CSS Builder plugins to add custom styles such as these. |
|
|
Awesome that did it. You are a genious. |
Thank you. I’m no genious… crazy, evil professor maybe, but no genius π Any further problems/questions just let us know. |
|
|
Tony, I just realized that the styles you offered above only works in Chrome. IE and Firefox display the address as: 1282 Centre Street |
In that case you’ll need to either create your own shortcode to pull in the information and display it how you prefer, or modify the code used to generate the default shortcode and override the default. The latter can be done by creating a new PHP file called custom_functions.php within /wp-content/uploads/espresso/ (the start of the file should be an opening php tag – Copy the espresso_venue_details_sc() function from \event-espresso\includes\shortcodes.php around line 667 to 840 and place the function within the file. Then remove the BR tags from the city, state and zip output. |
|
|
Thank you Tony |
You’re most welcome π |
|
|
Do I exclude this if (!function_exists(‘espresso_venue_details_sc’)) { on line 662 |
|
got it to work π |
|
spoke too soon. I was looking in Chrome. IE and Firefox are still returning the city, state and zip on separate lines. |
|
These are the 3 lines I removed the <br /> tags from. $html .= $venue->city != ” ? stripslashes_deep($venue->city) : ”; Do I need to make reference to the custom_function.php file any place other than placing it in /wp-content/uploads/espresso/? |
|
Sorry, I did get it to work this time. The only issue is there are no spaces between city and state and I need a comma after city. |
|
I able to figure out the comma and whitespace. |
Sorry for the delay, I’m glad you have this working but to answer your questions: Do I exclude this if (!function_exists(βespresso_venue_details_scβ)) { on line 662 No, that checks if the function already exists before attempting to declare it. It won’t actually make a difference because EE loads custom_functions.php before declaring its functions, but your best not including it.
That’s from this code: $html .= $venue->city != β ? stripslashes_deep($venue->city) : β; $html .= $venue->state != β ? stripslashes_deep($venue->state) : β; $html .= $venue->zip != β ? stripslashes_deep($venue->zip) : β; If checks if there is a value set for the variable If true it outputs the first section of code up to the
You want a comma and space after the value, so that should be:
If no value is set it outputs whatever is after the I know you’ve already figured this out but just adding here incase anyone else comes across this thread π |
|
The support post ‘Styling Venue Manager’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.