Tagged: , ,

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #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 6 years, 7 months ago by hotspot01.
    #855643

    the slug for the category Move-In Ready (Immediate) is move-in-ready

    #856173

    Hi 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,
    Victoria

    #856239
    This reply has been marked as private.
    #856540

    Hi 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,
    Victoria

    #856659

    I’ve updated it to php 5.6

    #856857

    Hi hotspot01,

    At what level and on what elements do you need that class?

    Best regards,
    Victoria

    #858290

    I’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

    #859048

    Hi,

    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,
    Ismael

    #862645

    The 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

    #863220

    Hi,

    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

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.