HTML field new lines
This topic contains 14 replies, has 4 voices, and was last updated by Paolo 8 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: html field, new line
-
AuthorPosts
-
February 2, 2016 at 1:46 pm #115721
Hi,
I have HTML field as a custom field. It works well when putting text inside, styling it, new lines etc. The problem is that the new lines do not appear on the front-end and I really need them to be there.
Any ideas?
Cheers.
February 2, 2016 at 2:01 pm #115729URL and WP admin details please in a private reply so we can have a look.
And details of the listing where you have that problem.
Thanks.February 2, 2016 at 2:29 pm #115744Could it be possible because I am outputting it like that:
echo $post->geodir_customhtmlfield;
in a custom function in functions.php?
Sending the login credentials with the next message.
February 2, 2016 at 2:37 pm #115746This reply has been marked as private.February 2, 2016 at 6:16 pm #115800Hi,
the cutom field output is wrapped by a H2 tag which is a block tag.
This is what you see in html source:
<h2>hello some simple field here to come i cannot do anything else then just to put new lines kk kk</h2>
Have your trying removing the h2 tags around it?
Let us know,
Thanks
February 2, 2016 at 6:52 pm #115814Just removed the h2 and changed it with span. The result is the same.
And without span – the same.
FYI, I am just hitting enter on front-end/back-end to create the new lines, like every average internet user would do it, without being necessary to write html code.
How a complete theme compatibility can be performed? Could it be anything related. I am using Headway Themes.
February 2, 2016 at 7:08 pm #115823Ok, I got you now, the HTML field is to add html code.
It isn’t a visual editor that will add html to the text.
The only fields that have tinyMCE integrated as an option are the listings description and the events registration (must be enabled in GD >> Design >> Listings >> Add lsiting settings).
If you want to have a description field above the tabs, you could hide the profile tab (unset it from old array and don’t set it again). Then use the same hook you used for that custom field to output
the_content()
and use a custom fields for the 1st tab instead.
Let us know if this helps.
Thanks
February 2, 2016 at 11:02 pm #115912My bad explaining what I am trying to achieve using the HTML field.
Ok, so no way to get another wysiwyg editor next to the one in the content 🙁
All starts with the search query looking in the content field. When I give this field for business info like ‘Who we are’, people write amazing stuff there that has nothing to do with their business, and thus the location appear in the search where it doesn’t belong. That’s why I want to give another field for this information and keep the content field explicitly for putting exact business Services.
That’s the whole point here.
Any news about coming extensions for the search query? I know it is a complicated thing, but may be you will find an easy way to be able to integrate simple text fields from the custom fields and make searching the content optional?
February 2, 2016 at 11:15 pm #115916It would be helpful just to be able to give more ‘scores’ to some businesses in the search. Is there currently any doc how much weight each of the search query included fields have – title, content, tags and categories?
I would like to be able to give some extra weight for example to tags. Anything like this possible with some hooks/actions?
Thanks.
February 3, 2016 at 11:13 am #116141Hi mb,
This is the weighting of a general search:
gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5
There is a filter to be able to filter the order by query here: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/listing_filters.php#L471
If you need more complicated ways to edit the query i would be happy to work with you to achieve that.Thanks,
Stiofan
February 3, 2016 at 11:59 am #116165Thanks Stiofan,
this is very helpful!
I am mostly still working on the design. Then, I will put some real listings data, testing the results and I can give a sign then, when I have more output.
Best
February 3, 2016 at 12:01 pm #116166No probs 🙂
February 3, 2016 at 11:14 pm #116725This reply has been marked as private.February 4, 2016 at 2:59 pm #117107Hi,
I managed to output the HTML field as I need it but it works only when I am pulling the fields values in a custom design for example.
If someone else might be interested, just wrap the field output like that:
echo wpautop( $post->geodir_customfieldhtml );
February 4, 2016 at 4:05 pm #117165Thanks for sharing, I’ve forwarded your question to Stiofan.
Thanks
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket