Skip to content

Instantly share code, notes, and snippets.

View jupago's full-sized avatar

Juan Pablo Gomez jupago

View GitHub Profile
<?php
// get repeater field data
$repeater = get_field('home_news');
// vars
$order = array();
// populate order
foreach( $repeater as $i => $row ) {
@jupago
jupago / content-news.php
Created February 5, 2018 17:07
ACF Repeater
<!-- ACF Recent news -->
<?php if( have_rows('home_news') ): ?>
<div class="flexgrid_wrapper news-wrapper">
<?php while( have_rows('home_news') ): the_row();
// vars
$date = get_sub_field('date', false, false);
$date = new DateTime($date);
<p class="flexgrid_author">
<?php $coauthors = get_coauthors(); ?>
<?php foreach( $coauthors as $coauthor ): ?>
<?php $userdata = get_userdata( $coauthor->ID ); ?>
<strong> <?php echo $coauthor->display_name; ?></strong>,
<?php echo get_the_author_meta( 'city', $coauthor->ID ); ?>&nbsp;<br>
<?php endforeach; ?>
</p>
// Include Coauthors
add_filter( 'facetwp_facet_sources', function( $sources ) {
if ( class_exists( 'coauthors_plus') && isset( $sources['taxonomies']['choices']['tax/author'] ) ) {
$sources['co_authors'] = array(
'label' => 'Co-Authors',
'choices' => array(
'tax/author' => 'Authors'
)
);
// Get Facet to recognize CoAuthors
add_filter( 'facetwp_facet_sources', function( $sources ) {
if ( class_exists( 'coauthors_plus') && isset( $sources['taxonomies']['choices']['tax/author'] ) ) {
$sources['co_authors'] = array(
'label' => 'Co-Authors',
'choices' => array(
'tax/author' => 'Authors'
)
);
}
<!DOCTYPE html>
<html>
<head>
<title>Add a title here!</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Pacifico" rel="stylesheet">
</head>
<body>
<div class="the-wrapper">
<div class="the-logo">
Isabella The Mayor
<!DOCTYPE html>
<html>
<head>
<title>Add a title here!</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Pacifico" rel="stylesheet">
</head>
<body>
<div class="the-wrapper">
<div class="the-logo">
Isabella The Mayor
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Pacifico" rel="stylesheet">
</head>
<body>
<div class="the-wrapper">
<div class="the-logo">
Isabella The Mayor
<!DOCTYPE html>
<html>
<head>
<title>Local incidents within our city</title>
<link href="https://fonts.googleapis.com/css?family=Taviraj:400,400i,600,600i" rel="stylesheet">
</head>
<body>
<div class="the-wrapper">
<div class="the-logo">
<img class="brian-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/95802/brianuceta_thumbnail.png"/>
<!DOCTYPE html>
<html>
<head>
<title>Local incidents within our city</title>
<link href="https://fonts.googleapis.com/css?family=Libre+Baskerville:400,400i,700" rel="stylesheet">
</head>
<body>
<div class="the-wrapper">
<div class="the-logo">
<img class="brian-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/95802/brianuceta_thumbnail.png"/>