Modify the description field on listing page

Hello,

I would like to add a “title” to the description (e.g. “Description:”) field on the single listing page and also to style the description text (change color ant text size).

After failing to do so by myself, I searched on the forum and found a promising fix from @aqmiami7 ( Can we show the label of description in listing details page and Make it first item to show on page ) for the Title part, which worked partially - the title was added but it was displayed at the very top. I managed to fix this by setting the order to 50 (numbers from 0 to 29 didn’t work, from trial and error) → maybe this will benefit others as well. There is still a small issue though - there is a bit too much space (like a whole line/enter) between the title and the description text now. I tried to fix this using CSS like “.hp-listing–view-page .hp-section__title { margin-bottom: 5px; }” but without luck. Any suggestions?

Then, for the styling part, I found this snippet recommended by Andrii ( Enable rich text (HTML) editor for the listing description #hivepress #listings · GitHub ) - went ahead and copied the same in functions.php, then added the following CSS to test if it’s working:

“.hp-listing–view-page .hp-listing__description { color: #333333; font-size: 1rem; }”

, but nothing changed.

Do you have any guess regarding what I’m doing wrong? Thanks a lot!

Hi,

This can be achieved with a few CSS tweaks. If you’re comfortable working with CSS, you can target the description section using the following selector: .hp-listing--view-page .hp-listing__description [seems that you missed the hyphen].

Hope this helps.

Hello @kseniia ,

Thanks for the suggestion - however, there are actually two hypens in my code, but for some reason when I pasted it here it “fused” them together in a break line.

Below you can find the code I am using and also how the text looks (which is basic, as the CSS does not apply):

Could you please confirm if this code works on your end? That would be unusual.

Thanks!

Hi,

The changes you made are pretty subtle.
Please try this snippet to see that changes are applied [here’s the outcome]:

.hp-listing--view-page .hp-listing__description { 
	color: red; 
	font-size: 25px;
}

Hope this helps

Hello @kseniia ,

Thanks a lot for showing me evidence, as it convinced me the code is fine. For some reason, it doesn’t work if I add it in Additional CSS, but it did work when I put it into the style.css file :slight_smile:

Much appreciated!

Glad to help! :woman_fairy:

Sometimes changes don’t appear in real time, and you need to click the Publish button to see them. It can also be caused by a third-party plugin.

If you have a minute, please rate HivePress on the WordPress repository. Your feedback means a lot to us and makes a real difference in helping us grow.

1 Like

Just dropped a review - thanks for bringing this up :slight_smile:

Would really appreciate if you could take a look at another pressing issue which has been messing with my head for the past days here: Two column layout on mobile view for category pages / related listings - #6 by Arthur

Thanks!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.