-
AuthorPosts
-
July 9, 2018 at 12:49 pm #983077
Hi!
I am building a site for a travel agency (link in private section) and on certain pages multiple destinations are displayed. The first two words are always the same and I would like to hide these words. Can you help with this? I’ve tried to work with nth-child and other css options but without any luck so far.
Hope you can help!
July 10, 2018 at 3:58 am #983468Hey Daniel,
Thanks for the link, so this is supposed to be conditional? If there are more than one destination those words should be hidden? How do we know if there are more than one destination on the page?
Best regards,
RikardJuly 10, 2018 at 7:58 am #983519Hi Rikard, yes it is conditional. I always use the blog element to display the title, the color section where it’s nested in always has the same custom class (.bestemmingen). Are those enough conditions?
July 10, 2018 at 12:44 pm #983619Hi,
Thanks for the feedback. There are no conditionals in CSS, so you would have to use the page-id class to do that manually if you want to hide them using CSS. If you want to use a PHP function then you would need to check if a variable is greater than 1 for instance, is there such a variable?
Best regards,
RikardJuly 10, 2018 at 12:57 pm #983629Hi,
Thanks for your reply. I’d very much like to fix this using CSS and since it’s only on six pages where I have to hide these words, that would be a workable solution. How would we do this using the page-id class(es)?
Daniel
July 11, 2018 at 4:03 am #983979Hi,
Thanks for the update.
This script should remove the word “Incentive reis”.
function ava_custom_script_remove_word() { ?> <script> (function($) { $('.slide-entry-title.entry-title a').each( function() { var text = $(this).text(); var newtext = text.replace(/Incentive reis /g, ''); $(this).text(newtext); }); })(jQuery); </script> <?php } add_action( 'wp_footer', 'ava_custom_script_remove_word', 9999 );Best regards,
IsmaelJuly 11, 2018 at 7:39 am #984051Hi Ismael,
This works like a charm, thanks!
July 11, 2018 at 8:26 am #984065Hi Daniel,
Glad that Ismael helped you :)
Feel free to comeback if you need further assistance.
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Hide words in title or change title in slide-entry’ is closed to new replies.
