the answer for all question about Oxygen Builder plugin and WordPress

I’m creating a ‘navigation bar’ with CPT items. There will generally only be 3 o


I’m creating a ‘navigation bar’ with CPT items. There will generally only be 3 or 4 items – they represent gallery categories/types).
I’m using the Oxy Repeater to display and format the items.
Can someone help with how I format, or target, the ‘current item’ please? Maybe there’s a different way I need to be doing this?
Thanks



Source

3 Comments
  1. Mianne Bagger says

    …I’m just looking into the Dynamic Classes function of Hydrogen Pack from Clean Plugins for WordPress

  2. Владимир Кеймар says

    This script searches for a link on the page that matches the address of the current page and assigns the “menu-item_active” class to this link. You can put your own name for the class.
    You just need to put the necessary styles for this class.

  3. Mianne Bagger says

    My solution was to write a custom query (although I do now have a ‘Flash of Unformatted Content’ to address 😕:

    ‘gallery’
    );

    // Query the posts:
    $thegalleries_query = new WP_Query($args);

    if ( $thegalleries_query ) {
    echo ‘

    ‘;

    // Loop through the Galleries and display them
    while ($thegalleries_query->have_posts()) : $thegalleries_query->the_post();
    $image = get_field( ‘gallery_thumbnail_image’);

    if ( ! empty( $image ) && get_the_id() == get_queried_object_id() ) {
    $gallery_tile = sprintf( ‘

    ‘,
    esc_url( get_the_permalink() ),
    $image,
    get_the_title()
    );
    } else {
    $gallery_tile = sprintf( ‘

    ‘,
    esc_url( get_the_permalink() ),
    $image,
    get_the_title()
    );
    }

    echo $gallery_tile;
    endwhile;

    echo ‘

    ‘;
    }

    // Reset Post Data
    wp_reset_postdata();
    ?>

Leave A Reply

Your email address will not be published.

Oxyrealm Docs