Skip to content

Instantly share code, notes, and snippets.

View landru247's full-sized avatar

Landru landru247

  • Earth
View GitHub Profile
@barbwiredmedia
barbwiredmedia / selector.php
Last active August 29, 2015 14:01
ACF advanced custom fields select in a repeater field to choose content layout or, anything else, within a wordpress page.
<?php if (get_field('page_content_repeater')) { ?>
<?php while (the_repeater_field('page_content_repeater')): ?>
<?php
/* Pull from users select choice in ACF */
$choice1 = 'string_1';
$choice2 = 'string_2';
?>
<?php if (get_sub_field('your_selection_field') === $choice1) { ?>
<!--Your Content-->
@barbwiredmedia
barbwiredmedia / afc-relationship.php
Last active July 27, 2020 23:14
Wordpress acf relationship field
<?php
$testimonial_check = get_field('your_relationship_field_name');
if ($testimonial_check) {
?>
<?php foreach (get_field('your_relationship_field_name') as $relationship): ?>
<p>"<?php echo get_post_meta($relationship->ID, 'some_field_content', true); ?>"</p>
<small><?php echo get_the_title($relationship->ID); ?> | <?php echo get_post_meta($relationship->ID, 'some_more_field_content', true); ?> </small>
<?php endforeach; ?>
@barbwiredmedia
barbwiredmedia / carousel-start.js
Last active September 18, 2020 20:30
bootstrap slider WordPress Dynamic Content ACF Custom Post Type loop Query Posts or gallery. Credit to Doug for this fantastic solution http://www.lanexa.net/2013/03/update-bootstrap-carousel-wordpress-dynamic-content/
@barbwiredmedia
barbwiredmedia / Functions.php
Created October 18, 2013 22:29
Wordress - Functions :Creating breadcrumbs listing pages post parents and children
//Bread crumbs created
function wordpress_breadcrumbs() {
$delimiter = '|';
$currentBefore = '<span class="current">';
$currentAfter = '</span>';
if ( !is_home() && !is_front_page() || is_paged() ) {
echo '<div id="crumbs">';
global $post;
if ( is_page() && !$post->post_parent ) {
echo $currentBefore;