Skip to content

Instantly share code, notes, and snippets.

View yanknudtskov's full-sized avatar

Yan Knudtskov yanknudtskov

View GitHub Profile
@yanknudtskov
yanknudtskov / functions.php
Last active February 7, 2019 12:44 — forked from billerickson/functions.php
Removing advanced custom fields from the frontend
<?php
$videos = get_post_meta( get_the_ID(), 'be_attorney_video', true );
if( $videos ) {
for( $i = 0; $i < $videos; $i++ ) {
$title = esc_html( get_post_meta( get_the_ID(), 'be_attorney_video_' . $i . '_title', true ) );
$video = esc_url( get_post_meta( get_the_ID(), 'be_attorney_video_' . $i . '_video', true ) );
$thumbnail = (int) get_post_meta( get_the_ID(), 'be_attorney_video_' . $i . '_thumbnail', true );
// Thumbnail field returns image ID, so grab image. If none provided, use default image
@yanknudtskov
yanknudtskov / template-landing.php
Last active February 9, 2019 23:38 — forked from billerickson/template-landing.php
Removing advanced custom fields from the frontend
<?php
/**
* Your Child Theme
*
* Template Name: Landing
*/
/**
* Flexible Content
*
@yanknudtskov
yanknudtskov / functions.php
Last active February 7, 2019 12:44 — forked from billerickson/functions.php
Removing advanced custom fields from the frontend
<?php
function be_call_to_action() {
$title = esc_html( get_option( 'options_be_cta_title' ) );
$button_text = esc_html( get_option( 'options_be_cta_button_text' ) );
$button_url = esc_url( get_option( 'options_be_cta_button_url' ) );
if( $title && $button_text && $button_url )
echo '<div class="call-to-action"><div class="wrap"><p>' . $title . '</p><p><a href="' . $button_url . '" class="button">' . $button_text . '</a></p></div></div>';
@yanknudtskov
yanknudtskov / archive.php
Last active February 7, 2019 12:44 — forked from billerickson/archive.php
Removing advanced custom fields from the frontend
<?php
/**
* Category Subtitle
*
*/
function be_category_subtitle() {
// Make sure this is a category archive
if( ! is_category() )
@yanknudtskov
yanknudtskov / search-by-algolia-for-woocommerce.php
Created August 22, 2019 13:51 — forked from rayrutjes/search-by-algolia-for-woocommerce.php
This is a boilerplate for using Algolia in WooCommerce
<?php
/**
* @wordpress-plugin
* Plugin Name: Search by Algolia for WooCommerce - Instant & Relevant results
*/
/**
* If Algolia is not active, let users know.