Skip to content

Instantly share code, notes, and snippets.

View mwangepatrick's full-sized avatar

Patrick N. Mwange mwangepatrick

View GitHub Profile
<?php if ( function_exists( 'have_rows' ) && have_rows( 'page_section' ) ) : ?>
<?php while ( have_rows( 'page_section' ) ) : the_row(); ?>
<?php get_template_part( 'content', 'page-section' ); ?>
<?php endwhile; ?>
<?php if (is_front_page() && count( get_field( 'page_section' ) ) > 1) : ?>
<section class="member-list">
<?php if( have_rows('repeater_field') ): ?>
<?php while ( have_rows('repeater_field') ) : the_row(); ?>
<?php $user = get_sub_field('user_field'); ?>
<?php $userID = array_values($user)[0]; ?>
<?php $first_name = get_user_meta($userID, 'first_name', true); ?>
@mwangepatrick
mwangepatrick / child-functions.php
Created October 6, 2016 17:17 — forked from yratof/child-functions.php
Load predefined JSON files by their name, then make the list accessible to child themes
<?php
class craft_child_features {
static function setup() {
add_filter( 'craft_acf_parent_features', __CLASS__ . '::craft_child_remove_acf_groups' );
}
/**
* [craft_child_remove_acf_groups description]
* @param [type] $features [description]
<?php
/**
*
* Create ACF single destination content
*
* Intro content
* Intro image
* jquery Accordion
*
* @since 1.0.0
<?php
/*
Update an ACF custom field in wordpress with all the dealer id's when a select all
checbox is ticked.
Created by craig@123marbella.com on 24th of July 2017
The ACF plugin is great but its not possible to "select all" records in a multi select
so we need to find a way to select all records so the user does not have to select each
record one by one. So easiest thing to do is make an extra checkbox field called "select all",
@mwangepatrick
mwangepatrick / file.php
Last active November 28, 2017 09:17 — forked from anonymous/file.php
Multi galerie in page - ACF
<div class="carou">
<?php if( have_rows('galerie_isolation') ):
while ( have_rows('galerie_isolation') ) : the_row(); ?>
<div class="title_slide">
<h3><?php $titre_galerie = the_sub_field('titre_galerie'); ?></h3>
<div class="nav">
<span class="ion-arrow-left-c prev-button"></span>
@mwangepatrick
mwangepatrick / file.php
Created December 4, 2017 11:18 — forked from GuillaumeEudes/file.php
Get the first row from a repeater
<?php
$rows1 = get_field('galerie_isolation' ); // get all the rows
$first_row1 = $rows[1]; // get the first row
$title1=$first_row1['titre_galerie'];
$first_row_image1 = $first_row1['les_images' ]; // get the sub field value
?>
<?php if( have_rows('galerie_isolation') ):