Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Archetyped

    (@archetyped)

    Thread Starter GrblFF

    (@grblff)

    The problem is that I read it. But can’t figure out where to use this tag. If I have field ACF, I in the ACF controller to insert this feature. Or still need to insert function.php themes. I tried in different ways, not working.

    Plugin Author Archetyped

    (@archetyped)

    Hi, basically you save a field’s output to a variable and pass that to slb_activate(). Here is ACF’s documentation for the get_field() function.

    Here’s a modified version of the code example on this page that covers the use of slb_activate():

    $content = get_field( "text_field" );
    if ( function_exists('slb_activate') )
     $content = slb_activate($content);
    echo $content;
    

    You can do this wherever you want to display a field’s data.

    If you are still having problems using slb_activate(), please provide an example of the code you are using and I would be glad to take a look.

    Thread Starter GrblFF

    (@grblff)

    Thank you for helping me. I have not changed the code of plugins simple-lightbox and advanced custom fields. I realize there is a tag slb_activate, but I can’t understand in which file I need to write it down. I will try to explain a little differently. Using ACF I have added fields to media files, such as additional description, author. In SLB displays standard fields such as name, description, caption. I need to add fields here. In the file SLB /themes/base template output layout.html In it all fields for output looks like {{item.description}}. I can’t understand how can I make {{item.Author}} brought me added the author box. It is difficult to understand the structure of advanced custom fields. I tried adding the code you suggested

    $content = get_field( "text_field" );
    if ( function_exists('slb_activate') )
     $content = slb_activate($content);
    echo $content;

    in advanced-custom-fields/core/api.php but it gave no result.

    Plugin Author Archetyped

    (@archetyped)

    Hi, as noted on the page I linked to in my previous replies, slb_activate() is a template tag. This means it can be used in your theme’s template files to activate blocks of content so that the links contained in that content can be displayed in the lightbox.

    slb_activate() is not used to change the data displayed in the lightbox itself. Currently, most of WordPress’ own media fields are supported in the lightbox, but fields added by third-party plugins such as ACF will need to be supported by an add-on in the future.

    Here is solution
    https://support.advancedcustomfields.com/forums/topic/acf-gallery-simple-lightbox-problem/
    mediawerk gave correct answer

    My problem was Flexslider and here is solution for it:

    <div id="mini_slider" class="flexslider fsdfs">
    	        <ul class="slides">
    	            <?php foreach( $images as $image ):
    	            	$size = $image['sizes']['gallery-large'];
    	            	$alt = $image['alt'];
    	                $content = '<li><a href="' . $size . '"><img src="' . $size . '" alt="' . $alt . '" /></a></li>';
    	        if ( function_exists('slb_activate') ) {
        				$content = slb_activate($content);
        			} ?>
        			<?php echo $content; ?>
    	            <?php endforeach; ?>
    	        </ul>
    	    </div>
    	    <div id="carousel" class="flexslider">
    	        <ul class="slides">
    	            <?php foreach( $images as $image ): ?>
    	                <li>
    	                    <img src="<?php echo $image['sizes']['gallery-small']; ?>" alt="<?php echo $image['alt']; ?>" />
    	                </li>
    	            <?php endforeach; ?>
    	        </ul>
    	    </div>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘slb_activate() & ACF’ is closed to new replies.