-
AuthorPosts
-
September 23, 2017 at 1:09 am #855638
I am working on updating a home builders site and we have a Quick Possessions page that shows homes in different stages. They’ve asked me to add a banner to images where the homes are Move-in Ready. Rather than do that manually to uploaded images I want to do it using css. I already have custom categories that are being used as filters on the page.
I also have already found a great corner ribbon code to use here
How do I tell wordpress that when the category ‘Move-in Ready (immediate)’ is applied to a entry I want that entry to have a custom class of ‘moveribbon’. That way the ribbon should automatically be displayed on all the applicable post entries.
I believe this can be done with an if statement but I’m not sure how. Any suggestions?
- This topic was modified 7 years, 2 months ago by hotspot01.
September 23, 2017 at 1:55 am #855643the slug for the category Move-In Ready (Immediate) is move-in-ready
September 24, 2017 at 6:32 pm #856173Hi hotspot01,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaSeptember 24, 2017 at 9:33 pm #856239This reply has been marked as private.September 25, 2017 at 3:57 pm #856540Hi hotspot01,
First of all, you should update your php, you have a huge notice in the dashboard. Many things might not work as they should with the php version you’re currently running.
Best regards,
VictoriaSeptember 25, 2017 at 6:43 pm #856659I’ve updated it to php 5.6
September 26, 2017 at 10:37 am #856857Hi hotspot01,
At what level and on what elements do you need that class?
Best regards,
VictoriaSeptember 29, 2017 at 3:27 am #858290I’m not too familiar with CSS levels but the ribbon is going on top of the home image (portfolio item) that has the category ‘Move-in Ready (immediate)’ .
Here is a mockup https://ibb.co/b1bUJw
October 2, 2017 at 4:23 am #859048Hi,
You need to be able to distinguish or select the post items by category or taxonomy. Unfortunately, the categories or taxonomies are not included in the markup by default so you have to modify the config-templabuilder > avia-shortcodes > postslider.php file. On line 505, you can insert the category or taxonomy name as class attribute.
$output .= "<article class='slide-entry flex_column {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}' $markup>";
What is the name of the “filter” plugin? Please ask them for the slug name of the “Availability” taxonomy or term.
Best regards,
IsmaelOctober 10, 2017 at 8:20 pm #862645The filter plugin I’m using is called Facet WP.
The slug for the Move in Ready Availability term is ‘move-in-ready‘I’m not quite sure how to implement this though
October 12, 2017 at 7:11 am #863220Hi,
Try to replace the code above with the following.
$availability = get_term( TERM ID HERE, 'TAXONOMY NAME HERE' ); $ready = $availability != '' ? 'move-in-ready' : ''; $output .= "<article class='slide-entry flex_column {$ready} {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}' $markup>";
Adjust the “TERM ID” width the id of the “move-in-ready” term and the “TAXONOMY NAME” with the “Availability” taxonomy name. If the post item has the term “move-in-ready”, the class attribute “move-in-ready” will be added to the slide-entry or item container.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.