Support

Account

Home Forums General Issues Custom template – where to put field data

Solved

Custom template – where to put field data

  • Hi, I set up 2 fields for a map and description. They change my layout and put the sidebar under the fields. I figured I needed to insert the fields into a custom template but not sure where.
    This is the theme’s custom template:

    get_header();
    ?>
    <div id="main-col">
    	<div id="content" class='hfeed content'>
    		<?php
    		if (have_posts()) {
    			while (have_posts()) {
    				the_post();
    				global $post;
    				$hide_title = suffusion_get_post_meta($post->ID, "suf_hide_page_title", true);
    				if (!$hide_title) {
    					the_title("<h1 class='cl-title'>", "</h1>");
    				}
    				for ($i = 1; $i <= 5; $i++) {
    					do_action('suffusion_before_custom_layout_widgets', $post, $i);
    					if (!suffusion_is_sidebar_empty('sidebar-cl-'.$i)) {
    						$default_cols = "suf_clt_wa{$i}_cols";
    						$default_height = "suf_clt_wa{$i}_widget_height";
    						$default_skinning = "suf_clt_wa{$i}_skin_setting";
    						global $$default_cols, $$default_height, $$default_skinning;
    						$cols = suffusion_get_post_meta($post->ID, "suf_cpt_wa{$i}_cols", true);
    						if ($cols == '') {
    							$cols = $$default_cols;
    						}
    						$widget_height = suffusion_get_post_meta($post->ID, "suf_cpt_wa{$i}_widget_height", true);
    						if ($widget_height == '') {
    							$widget_height = $$default_height;
    						}
    						$custom = '';
    						if ($$default_skinning) {
    							$custom = 'custom-skin';
    						}
    						echo "\n<section id='cl-warea-id-$i' class='cl-warea cl-warea-$cols cl-warea-id-$i cl-warea-$widget_height $custom fix'>";
    						dynamic_sidebar('sidebar-cl-'.$i);
    						echo "</section><!-- widget area #cl-warea-id-$i -->\n";
    						wp_reset_postdata();
    					}
    					do_action('suffusion_after_custom_layout_widgets', $post, $i);
    				}
    			}
    		}
    		?>
    	</div><!-- content -->
    </div><!-- main col -->
    <?php get_footer(); ?>

    and this is my custom template:

    get_header();
    ?>
    	<div id="main-col">
    		<div id="content" class='hfeed content'>
         	 <?php if(get_field('maps')): ?>
    			<div id="maps">
    			<?php while(the_repeater_field('maps')): ?>
    			<img src="<?php the_sub_field('image'); ?>" alt="<?php the_sub_field('image_alt');?>" />
                <?php the_sub_field('description');?>
    	    <?php endwhile; ?>
    	<?php endif; ?>
             </div>
       </div>
    <?php get_footer(); ?>

    looks like this at the moment: http://mydog.ie/wordpress/maps2/

    I just want image on left, description on right and my sidebar far right. Any help so much appreciated – I’m not a programmer and it’s taken me 3 days just to get the maps to appear!

  • Hi @Ailsa_C

    This is not an issue regarding ACF or an inability to load data, but a question on how to use HTML and CSS to create a design.

    This question would be best asked on another forum such as stackexchange as this forum is for issues regarding ACF.

    I agree that you are using ACF to create the HTML, but I don’t offer free support foru basic CSS / HTML help.

    Thanks for understanding

    Cheers
    Elliot

  • Hi Elliot,
    Thanks for reply and suggestion. Yes I see now it’s a different issue. Will post this to another forum. Wish you continued success with ACF.
    A

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Custom template – where to put field data’ is closed to new replies.