Skip to content

Instantly share code, notes, and snippets.

name: myproject
recipe: wordpress
config:
php: '7.3'
xdebug: false
proxy:
theme:
class f6_dropdown_menu extends Walker_Nav_Menu {
// Add vertical menu class and submenu data attribute to sub menus
function start_lvl( &$output, $depth = 0, $args = array() ) {
$indent = str_repeat( "\t", $depth );
$output .= "\n$indent<ul class=\"vertical menu dropdown\">\n";
}
@campaignupgrade
campaignupgrade / functions.php
Last active March 15, 2019 04:19
Advanced Ads — Convert <div> to <aside>
<?php
/**
* Changes ad wrapper <div> element to <aside> element
* Does not work with cache-busting containers
*
* @param string $output ad output.
* @param object $ad Advanced_Ads_Ad object.
*
* @return string
@campaignupgrade
campaignupgrade / find-wordpress-root.sh
Created March 10, 2019 00:31
Finds WordPress root from any subdirectory in the WordPress install
while [ ! -e wp-config.php ]; do
if [ $pwd/ = / ]; then
echo "No Wordpress root found" >&2; exit 1
fi
cd ../
done
if [ -e wp-config.php ]; then
wproot=$(pwd)
fi
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
@campaignupgrade
campaignupgrade / README-Sage-9-to-WPEngine.md
Last active April 28, 2018 03:29 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Sage 9 to WPEngine Deployment setup

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@campaignupgrade
campaignupgrade / App.php
Last active April 14, 2018 04:45
Multiple values in an array variable in Sober Controller (Sage 9)
// in controller
public function homepageFields() {
return array (
$subheading => get_field('subheading'),
$video = get_field('video_link')
)
}
DATE(booking_time) <= '2012-12-28'
Source Joomla website renders correctly:
http://www.truth-out.org/article/item/42794
In Joomla content in MySQL before export:
<div><span class="wf_caption" style="display: block; max-width: 640px; width: 100%;"><img src="http://www.truth-out.org/images/Images_2017_12/2017_1204td1.jpg" alt="(Image: Muhammad Ansi, Untitled (Pier), 2016.)" width="640" style="width: 100%; margin: auto;" /><span style="margin-top: 3px; display: block;">(Image: <a href="https://www.artfromguantanamo.com/muhammad-ansi-1/" >Muhammad Ansi</a>, Untitled [Pier], 2016.)</span></span></div>
<div>&nbsp;</div>
In XML export file:
@campaignupgrade
campaignupgrade / WPAllImport disable check duplicates
Last active January 4, 2018 00:00
WpAllImport skip dupe check
add_filter( 'wp_all_import_is_check_duplicates', 'wpai_is_check_duplicates', 10, 2 );
function wpai_is_check_duplicates( $is_check_duplicates, $import_id ) {
return false;
}