Skip to content

Instantly share code, notes, and snippets.

@zogot
zogot / index.php
Created May 13, 2013 06:55
Limit WordPress content by words.
<?php // where 15 is the word limit ?>
<?php echo apply_filters( 'the_content', wp_trim_words( get_the_content(), 15, '&hellip;' ) ); ?>
@zogot
zogot / gist:5500940
Last active December 16, 2015 21:39 — forked from Clorith/gist:5500932
<?php
function breadcrumbs() {
?>
<?php if ( ! is_home() ) : ?>
<?php global $post; ?>
<a href="<?php bloginfo( 'wpurl' ); ?>">Home</a> &raquo;
<?php
<?php
// call this method inside the method that shows the metabox contents
function prefix_upload_inputs() {
global $post;
wp_enqueue_media();
$scripts = "
<script type='text/javascript'>
jQuery(document).ready(function($){
<?php
namespace Project\Planets;
class Planet
{
protected $name;
/**
* @var Resource[]
protected function map(SoundGroupModel $soundGroupModel)
{
$soundGroupArray = $soundGroupModel->toArray();
$soundGroup = $this->mapper->map($soundGroupArray);
$customFiles = $soundGroup->getCustomFiles();
foreach ($soundGroupModel->files as $soundGroupFileModel) {
// Needed variables
$name = $soundGroupFileModel->name;
<?php
namespace App\Setting;
use Illuminate\Contracts\Support\Arrayable;
class SettingRequest implements Arrayable
{
protected $code;