For PHP questions like this. Please let me know if can help or recommend your favorite form since I’m trying to learn PHP and ACF.
Here’s the code for this WordPress page
Below that is the ACF callouts that works fine on it’s own file.
How do I integrate the callouts snippet below the slideshow?
get_header(); ?>
<?php if(!wp_is_mobile()) { ?>
<div id="primary-one" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-page-image">
<?php the_post_thumbnail(); ?>
</div><!-- .entry-page-image -->
<?php endif; ?>
<?php echo isset($_GET['jsn']) ? do_shortcode('[empc_meetings_beta]') : do_shortcode("[empc_meetings]"); ?>
<?php
if(wp_is_mobile()==FALSE) {
echo do_shortcode("[pb_slideshow group=2]");
}
?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php } else {?>
<div id="primary-one-mobile" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-page-image">
<?php the_post_thumbnail(); ?>
</div><!-- .entry-page-image -->
<?php endif; ?>
<?php echo isset($_GET['jsn']) ? do_shortcode('[empc_meetings_beta]') : do_shortcode("[empc_meetings]"); ?>
<?php
if(wp_is_mobile()==FALSE) {
echo do_shortcode("[pb_slideshow group=2]");
}
?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php }?>
<?php get_footer(); ?>
<?php
if (get_field('callouts')) : ?>
<? while (the_repeater_field('callouts')) : ?>
<div class="callout">
<a href="<?=get_sub_field('callout_url')?>">
<h2><?=get_sub_field('callout_title')?></h2>
<? $photo = get_sub_field('callout_icon'); ?>
<img src="<?=$photo['url']?>" alt="<?=$photo['alt']?>" class="img-callout" />
<span><?=get_sub_field('callout_text')?></span>
</a>
</div>
<? endwhile; ?>
<?php endif; ?>
Hi @jknetdesign
You can have the code looking like so:
get_header(); ?>
<?php if(!wp_is_mobile()) { ?>
<div id="primary-one" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-page-image">
<?php the_post_thumbnail(); ?>
</div><!-- .entry-page-image -->
<?php endif; ?>
<?php echo isset($_GET['jsn']) ? do_shortcode('[empc_meetings_beta]') : do_shortcode("[empc_meetings]"); ?>
<?php
if(wp_is_mobile()==FALSE) {
echo do_shortcode("[pb_slideshow group=2]");
}
?>
<?php
if (get_field('callouts')) : ?>
<? while (the_repeater_field('callouts')) : ?>
<div class="callout">
<a href="<?=get_sub_field('callout_url')?>">
<h2><?=get_sub_field('callout_title')?></h2>
<? $photo = get_sub_field('callout_icon'); ?>
<img src="<?=$photo['url']?>" alt="<?=$photo['alt']?>" class="img-callout" />
<span><?=get_sub_field('callout_text')?></span>
</a>
</div>
<? endwhile; ?>
<?php endif; ?>
<?php endwhile; // end of the loop. ?>
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.