No longer kept up to date.
Please see Sridhar's fork.
// https://codepen.io/cmykw/pen/gemxJm | |
// layout | |
<nav/> | |
// style | |
<style> | |
body { min-height: 200vh; } | |
nav { |
input { | |
height: 34px; | |
width: 100%; | |
border-radius: 3px; | |
border: 1px solid transparent; | |
border-top: none; | |
border-bottom: 1px solid #DDD; | |
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF; | |
} |
/* I'll put here different examples of dynamic query for Oxygen repeater : | |
* - Use one of the following repeater_dynamic_query definitions | |
* in code block just BEFORE the repeater | |
* - Set the repeater custom query settings : post type, number of posts, order... | |
* - Add the remove_action in a code block AFTER the repeater | |
*/ | |
/**************************************************************************************************** | |
* Display related posts for any CPT with taxonomy: |
<?php | |
// do NOT include the opening line! Just add what's below to the end of your functions.php file | |
add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' ); | |
function rgc_posts_page_edit_form( $post ) { | |
$posts_page = (int) get_option( 'page_for_posts' ); | |
if ( $posts_page === $post->ID ) { | |
add_post_type_support( 'page', 'editor' ); | |
} |
<script> | |
// Create an array of images that you'd like to use | |
var images = [ | |
'image1.jpg' | |
, 'image2.jpg' | |
, 'image3.jpg' | |
]; | |
// Get a random number between 0 and the number of images | |
var randomNumber = Math.floor( Math.random() * images.length ); |
No longer kept up to date.
Please see Sridhar's fork.
var script = document.createElement("script"); | |
script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
document.body.appendChild(script); | |
}, false); | |
document.body.appendChild(script); |
<?php | |
/** | |
* Add a apply_to and in_use column to Oxygenbuilder2.0's ct_templates overview. | |
* It will: | |
* - tell you the rules on the templates | |
* - show you if a re-usable is being used on a post/page/cpt so if not, you can safely delete it. | |
*/ | |
add_filter('manage_edit-ct_template_columns', 'add_new_ct_template_columns'); | |
/** |
<?php | |
// Make sure to prefix the function if you do not use a namespace. | |
// namespace TimJensen\HelperFunctions; | |
/** | |
* Returns an auto generated post excerpt, or a manual excerpt if one has been set. | |
* | |
* @version 1.2.1 | |
* | |
* @param int $post_id Required. Post ID. |