This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Translate the GeneratePress 404 page title | |
* | |
* The string can be translated in Languages -> Strings translations | |
*/ | |
if ( function_exists( 'pll_register_string' ) ) { | |
function mattrad_404_text() { | |
$error_text = 'That page cannot be found'; | |
pll_register_string( '404', $error_text , 'text_domain'); | |
return pll__( $error_text ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add Polylang language switcher before GeneratePress navigation | |
* | |
* @link https://polylang.pro/doc/function-reference/ | |
*/ | |
if ( ! function_exists( 'generate_navigation_position' ) || ! function_exists( 'pll_the_languages' )) { | |
function mattrad_add_switcher() { | |
pll_the_languages([ | |
'dropdown' => 1, | |
'hide_if_empty' => 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set GeneratePress site logo based on Polylang current language | |
* | |
* This example function allows for the default logo to be set by the English choice, and supports | |
* Polish, Dutch and German language-specific logos | |
*/ | |
if ( ! function_exists( 'generate_construct_logo' ) || ! function_exists( 'pll_current_language' ) ) { | |
// Change logo depending on the language | |
// An improvemnt to this would be to not set the array of logos, but check for a logo/language match | |
function mattrad_default_logo( $url ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Post Categories | |
* | |
* Get Primary term, if set, and other terms for a post (with Primary Term excluded) | |
* | |
* @category Theme | |
* @package MattRadford/mattradford | |
* @author Matt Radford <matt@mattrad.uk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('admin_menu', [$this, 'promoteCategories']); | |
/** | |
* Promote Categories to a top-level menu item | |
* | |
* @return void | |
*/ | |
public function promoteCategories() | |
{ | |
remove_submenu_page('edit.php', 'edit-tags.php?taxonomy=category'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pewc_get_multicurrency_price( $price ) { | |
// Compatibility with WooCommerce multilingual | |
$price = apply_filters( 'wcml_raw_price_amount', $price ); | |
if( class_exists('WOOCS') ) { | |
global $WOOCS; | |
if ($WOOCS->is_multiple_allowed) { | |
$price = $WOOCS->woocs_exchange_value( floatval( $price ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WordPress Build & Deploy Theme | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# WP Commandline Local Install, by Brian Richards (@rzen) | |
# | |
# Creates a new directory, downloads WordPress, creates a database, sets up wp-config, | |
# optionally empties wp-content, and deletes other misc files. This compliments my local | |
# dev setup, outlined here: http://rzen.net/development/local-develoment-in-osx/ | |
# | |
# Credit: | |
# Based on WPBuildr (https://github.com/AaronHolbrook/wpbuildr/). Props to Aaron Holbrook |
NewerOlder