Support

Account

Forum Replies Created

  • I managed to resolve it, I have found this filter to do so.
    acf/fields/taxonomy/wp_list_categories

  • Hello. I am checking if there are any updates for this topic?

    Thanks!!

  • Turns out it was a typo..
    $couner == 2

  • Hello I am trying to limit the gallery show only 2 images. But it doesn’t seem to work. Any idea what am I doing it wrong here?
    Thanks

    <?php
    
    // if ACF is not active, abort.
    if ( ! class_exists( 'acf' ) ) {
    	return;
    }
    
    $images = get_field( 'main_product_gallery' );
    $size = 'medium'; // (thumbnail, medium, large, full or custom size)
    if ( $images ) {
    	$counter = 1;
    ?>
    <div class="product-gallery">
    	<?php
    	foreach( $images as $image ) {
    	?>
    	<div class="product-gallery__image-wrap ratio-1-1">
    		<?php echo wp_get_attachment_image( $image['ID'], $size );?>
    	</div>
    	<?php 
    		$counter++;
    		if ($couner == 2) {
    			break;
    		}
    	}
    	?>
    </div>
    <?php
    }
    
    ?>
  • I see!! So I changed the code like below. It seems to work

    Thanks

    <?php if ( $site = get_field( 'vendor_fb' ) ) : ?>
        <?php
        $site = str_replace(array('http://', 'https://'), '', $site);
        $site = rtrim($site, '/');
        $url = get_field( 'vendor_fb' );?>
        <a class="vendor-link" href="<?php echo $url ?>" target="_blank"><?php echo $site ?></a>
    <?php endif; ?>
  • Here is my code. It return the correct name but not the url itself
    It looks like this on my site
    “facebook.com/abcphotography”
    href = my.site.com/facebook.com/abcphotography

    Does anyone know why the root url is there?
    Thanks

    <?php if ( $site = get_field( 'vendor_fb' ) ) : ?>
        <?php
        $site = str_replace(array('http://', 'https://'), '', $site);
        $site = rtrim($site, '/');?>
        <a class="vendor-link" href="<?php echo $site ?>" target="_blank"><?php echo $site ?></a>
    <?php endif; ?>
Viewing 7 posts - 1 through 7 (of 7 total)