WordPress working with ACF Pro
One of the best features of the WordPress plugin “Advanced Custom Field (ACF)” is the ability not just to add custom fields, but by extension the abilty to create field type called ‘repeat’.
This lets editors add rows of content that is associated with a field (in a crude way it’s like having relational data).
So, having created the field and poplated it with data (for example, adding multiple images to a post to are presented in a table)
<?php
// test if the ACF field has rows
if( have_rows(‘image_sliders’) ):
// run through the rows to get elements in each row
while ( have_rows(‘image_sliders’) ) : the_row();
// get_sub_field is the key
$theImage=get_sub_field(‘slider_image’);
$theImg=$theImage[‘url’];
$theLink=get_sub_field(‘slider_image_url’);
echo “<div class=’imagecon’><a href=”.$theLink.”><img src=”.$theImg.”></a></div>”;
endwhile;
else :
endif;
// clear query after use
wp_reset_query();
?>
Adwords (1)
Branding (13)
- Branding 101
- Why we don’t offer standard prices
- Graphic Design Brisbane
- How much should we spend on corporate rebrand
- How to choose a domain name
- Review of latest free web safe Google fonts
- Logo Design
- Logo Design Brisbane
- Is Company Branding Important to Logo Design?
- Questions to consider before building your website.
- Redesigning logos the right way
- Small business branding or Product branding ?
- Why redesign a website
CMS (3)
CSS (6)
Graphic Design (6)
Javascript (1)
PHP (3)
SEO (5)
tech support (5)
Web Design (10)
- Difference between fluid, reponsive & adaptive design
- Why we don’t offer standard prices
- Example of working print.css file
- Graphic design is more than just logos
- Why pay to maintain my website
- Questions to consider before building your website.
- Sample reset css file for web project
- WordPress – 5 reasons why you should use it
- Why redesign a website
- WordPress – Why not to use it.
Web Development (10)
- How risky are WordPress plugins
- Displaying dates using PHP
- jquery conflicts – how to avoid
- Modify the admin menu bar in WordPress
- Why pay to maintain my website
- Questions to consider before building your website.
- Recent updates to Google search results explained
- Sample reset css file for web project
- Why upgrade WordPress if it’s working
- Use Transient to speed up WordPress
Wordpress (17)
- How risky are WordPress plugins
- Bootstrap & Less – compile online
- How important is https for my website
- Create content that will be read
- Modify the admin menu bar in WordPress
- Why upgrade WordPress if it’s working
- Use Transient to speed up WordPress
- WordPress – 5 reasons why you should use it
- WordPress – adding Google Fonts
- WordPress – CF7 – select fields – CPT
- WordPress – what plugins should developers use
- WordPress – Tinymce extra plugins
- WordPress – Why not to use it.
- WordPress working with ACF Pro
- WordPress – working with cookies – Javascript
- WordPress – working with cookies – PHP
- Displaying categories in sidebar using javascript, jquery & php