Skip to content

Instantly share code, notes, and snippets.

/**
* Declares translations for Portfolio Fields in Polylang
*/
if ( function_exists( 'pll_register_string' ) ) {
global $quadro_options;
// Loop through fields and and declare translatable strings
if ( is_array( $quadro_options['portfolio_fields'] ) && !empty( $quadro_options['portfolio_fields'] ) ) {
/**
* Replaces content for single portfolio item
*/
function modified_single_portfolio_item( $item_id ) {
// Get a global post reference since get_adjacent_post() references it
global $post, $quadro_options;
// Get Item ID from ajax call if there is
$item_id = isset( $_POST['item_id'] ) ? esc_attr( $_POST['item_id'] ) : $item_id;
function at_allow_nbsp_in_tinymce( $mceInit ) {
$mceInit['entities'] = '160,nbsp,38,amp,60,lt,62,gt';
$mceInit['entity_encoding'] = 'named';
return $mceInit;
}
add_filter( 'tiny_mce_before_init', 'at_allow_nbsp_in_tinymce' );
remove_action( 'qi_top_site_content', 'at_header_cart', 10 );
add_action( 'qi_top_site_content', 'at_header_cartx', 10 );
/**
* Prints Header Cart Contents
*/
function at_header_cartx() {
global $woocommerce, $quadro_options;
<?php
/**
* The template for displaying Category pages.
*
* @package quadro
*/
get_header(); ?>
<?php // Retrieve Theme Options
<?php
/**
* The template for displaying Category pages.
*
* @package quadro
*/
get_header(); ?>
<?php // Retrieve Theme Options
function at_turn_upload_to_camera() {
?>
<script>
jQuery(document).ready(function() {
jQuery( 'input[type="file"]' ).attr( 'capture', 'camera' );
});
</script>
<?php
}
add_action( 'wp_footer', 'at_turn_upload_to_camera' );
function quadro_posted_on( $format = '', $atts = '' ) {
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string .= '<time class="entry-date updated" datetime="' . esc_attr( get_the_modified_date( 'c' ) ) . '">' . esc_html( get_the_modified_date( $format ) ) . '</time>';
$last_updated = 'Last updated on ';
} else {
$time_string = '<time class="entry-date published" datetime="' . esc_attr( get_the_date( 'c' ) ) . '">' . esc_html( get_the_date( $format ) ) . '</time>';
$last_updated = 'Published on ';
}
function at_always_burger_menu() {
?>
<script>
// Clone current menu
var mobileMenu = jQuery( document.getElementById('site-navigation') ).clone(),
rightMobile = jQuery( document.getElementById('primary-right-navigation') ).clone();
// Add Right Primary Menu if set
if ( jQuery( document.getElementById('primary-right-navigation') ).length ) mobileMenu.find('ul.menu').append( rightMobile.find('ul.menu > li') );
var isMobileMenu = true;
// Modify menu class
/**
* Display navigation to next/previous post when applicable (with thumbnails),
* while keeping navigation inside the same category.
*/
function quadro_post_nav( $older = '&larr;', $newer = '&rarr;', $thumb_size = 'medium', $use_thumbs = true ) {
// Don't print empty markup if there's nowhere to navigate.
$previous = get_adjacent_post( false, '', true );
$next = get_adjacent_post( false, '', false );
if ( ! $next && ! $previous ) {