Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • What’s the technical background of this delay and why does the paid version fix it?

    Thread Starter colibriinteractive

    (@colibriinteractive)

    Thanks @bcworkz I’ll try it with a custom solution then.

    I can confirm that it’s the WooCommerce Multilingual plugin loading the admin.css in the frontend. As soon as I deactivate the plugin the issue is gone.
    Even the newest version today 4.0.2 causes the issue!

    Thread Starter colibriinteractive

    (@colibriinteractive)

    Thanks for you reply!

    I’m using this code currently directly in the content-product.php which works fine but I give you version a try to. Looks a bit cleaner!

    $default_wishlists = is_user_logged_in() ? YITH_WCWL()->get_wishlists( array( 'is_default' => true ) ) : false;
    
    if( ! empty( $default_wishlists ) ){
        $default_wishlist = $default_wishlists[0]['ID'];
    }
    else{
        $default_wishlist = false;
    }
    if(YITH_WCWL()->is_product_in_wishlist( $product->id, $default_wishlist )) {
        echo 'A';
    } else {
        echo 'B';
    }

    I get back to you if I need a hand again.

    Thanks!
    Felix

    Thread Starter colibriinteractive

    (@colibriinteractive)

    Thanks for your feedback!
    How can I check if a product is already added to the wishlist?
    I found the ‘exists’ parameter but not sure how to use it.
    When I do an echo do_shortcode('[yith_wcwl_add_to_wishlist exists]'); I get the same as without it ??

    What I’m looking for is to show icon A to add it to the wishlist and button B if it’s already added.

    Thanks in advance!
    Felix

    Thread Starter colibriinteractive

    (@colibriinteractive)

    Found a solution at the docs that works great for me. Maybe someone else has can use it too:

    if (get_post_gallery()) {
        echo get_post_gallery($post->ID,1);
    }

    https://codex.www.ads-software.com/Function_Reference/get_post_gallery

    CI

    Thread Starter colibriinteractive

    (@colibriinteractive)

    I think I might need halp again. Suddenly my code stopped working and I don’t get any gallery displayed anymore.
    I give your code a try now which works generally good. But it displays “all” galleries.
    What I’m looking for is only the gallery of the “current” post (“current” while the loop is running).
    What I’m trying to do is: I have a overview page (homepage) and if a post has a gallery I want to show it at the post (on the homepage) to generate a slideshow with javascript from it.So if it works I have a lot of posts with a lot of little slideshows right at the posts all on one page.

    So my current code (from a theme that I’m customising) looks like this:

    <?php
    			$cat_id = wt_get_option('wt_feat_postlist_cat');
    			$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    
    			$args = array(
    				'cat' => $cat_id,
    				'post_status' => 'publish',
    				'ignore_sticky_posts' => 1,
    				'paged' => $paged
    			);
    		?>
    		<?php $i = 0; ?>
    		<?php $query = new WP_Query( $args ); ?>
    			<?php if ( $query -> have_posts() ) : ?>
    				<?php while ( $query -> have_posts() ) : $query -> the_post(); ?>
    					<?php
    						$post_class ="";
    						if ( $i % 2 == 1 ){
    							$post_class =" col-last";
    						}
    					?>
    					<div class="col col-425<?php echo $post_class; ?>">
    						<?php get_template_part( 'content', 'excerpt' ); ?>
    					</div>
    					<?php $i++; ?>
    				<?php endwhile; ?>
    			<?php endif; ?>

    At the get_template_part( 'content', 'excerpt' ); part comes a template in that generates the DOM for the output.
    When I paste your script in there, it returns, as mentioned, all galleries from the entire website. And with my initial echo do_shortcode('[gallery columns="1" size="full" filter="raw"]'); retuned only the gallery of exact that post. But that stopped working, somehow ??

    I hope somebody can give me a hand on this! Thanks in advance!!
    CI

    Thread Starter colibriinteractive

    (@colibriinteractive)

    Thanks!
    I’m doing it via
    echo do_shortcode('[gallery columns="1" size="full" filter="raw"]');
    inside a loop now.

    The only thing I don’t like is the DOM around the images. They have A tags and DL tags and all that.
    What I’m looking for are just the plain IMG tags. Is there a way to get that?

    The docu tells me that [gallery itemtag="div" icontag="span" captiontag="p"] will do something in that direction but I haven’t had success with that ??

    CI

Viewing 8 replies - 1 through 8 (of 8 total)