This file contains hidden or 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
{# beware of gallery shortcodes #} | |
{% set content = function('strip_shortcodes', item.get_preview(80,false,"",true)) %} | |
{# strip tags #} | |
{{ function("strip_tags", post.content)|truncate(50) }} | |
{{ content|striptags|truncate(50) }} | |
function custom_trim($value, $limit = 100, $end = '...'){ | |
$value = strip_tags($value); | |
if (mb_strwidth($value, 'UTF-8') <= $limit) { |
This file contains hidden or 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 _run_once(){ | |
$posts = get_posts(array( | |
'numberposts' => -1, | |
'post_type' => 'place' | |
) | |
); | |
foreach($posts as $p) : | |
// $meta = get_post_meta($p->ID, 'advertiser_type',true); |
This file contains hidden or 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
curl "http://loripsum.net/api/5/medium/decorate/link/ul/ol/dl/bq/code/headers/" | sed "s/<\/p>/<\/p>/" | wp post generate --post_content --count=10 |
This file contains hidden or 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
{{ function("strip_tags", post.content)|truncate(50) }} |
This file contains hidden or 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 | |
add_action( 'init', function() | |
{ | |
// Get all the posts which is assigned to the uncategorized category | |
$args = array( | |
'post_type' => 'cp_crq_news', | |
'posts_per_page' => -1, // Adjust as needed | |
'cat' => 84, // Category ID for uncategorized category | |
'fields' => 'ids', // Only get post ID's for performance | |
// Add any additional args here, see WP_Query |
This file contains hidden or 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
<html> | |
<head> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" > | |
<link rel="stylesheet" href="mystyle.css" > | |
<style> | |
.circle{ | |
height:200px; | |
width:200px; | |
background-color: red; | |
border:1px solid green; |
This file contains hidden or 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
'meta_query' => [ | |
'date_' => [ | |
'key' => 'start_date', | |
'compare' => 'EXISTS', | |
], | |
'time_' => [ | |
'key' => 'start_time', | |
'compare' => 'EXISTS', | |
], | |
], |
This file contains hidden or 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 -e | |
#modified to personal user by 2046, original - https://www.ltconsulting.co.uk/automated-wordpress-installation-with-bash-wp-cli/ | |
wpuser='2046' | |
clear | |
echo "=================================================================" | |
echo "Awesome WordPress Installer!!" | |
echo "=================================================================" |
This file contains hidden or 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 be_attachment_field_credit( $form_fields, $post ) { | |
// | |
// ---- CS --- | |
// | |
$form_fields['media_date'] = array( | |
'label' => 'Datum', | |
'input' => 'text', | |
'value' => get_post_meta( $post->ID, 'media_date', true ), | |
// 'helps' => 'datace', |
This file contains hidden or 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
wp plugin install custom-content-type-manager simple-image-sizes codepress-admin-columns adminimize |