Skip to content

Instantly share code, notes, and snippets.

<?php
$file = fopen("dicar.csv","r");
while (($data = fgetcsv($file)) !== FALSE) {
//echo "<pre>";print_r($data);
$split_old_url = explode("?", $data[0]);
$querystring = $split_old_url[1];
$url = $split_old_url[0];
$url = explode('/', $url);
//
// Set extra styles for TINY MCE
// 1. Enable the styles dropdown
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
// 2. Add the correct style
function mens_project_init() {
register_post_type( 'mens_project', array(
'hierarchical' => false,
'public' => true,
'show_in_nav_menus' => true,
'show_ui' => true,
'supports' => array( 'title', 'editor', 'thumbnail' ),
'has_archive' => false,
'query_var' => true,
'rewrite' => array(
//
// Set extra styles for TINY MCE
// 1. Enable the styles dropdown
add_filter( 'mce_buttons_2', 'my_mce_buttons_2' );
function my_mce_buttons_2( $buttons ) {
array_unshift( $buttons, 'styleselect' );
return $buttons;
}
// 2. Add the correct style
module.exports = function(grunt) {
// 1. All configuration goes here
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
sass: {
files: ['*.{scss,sass}'],
tasks: ['sass:dist','postcss:dist']
},
for($x = 0; $x < $total_page_count; $++) {
echo '<a href="#">' . ($x+1) . '</a>';
}
<!-- fout -->
<img src=''mijnafbeelding.jpg'' />
<!-- juist -->
<img src="mijnafbeelding.jpg" />
// global $wp_styles;
// echo "<pre> before colors";print_r($wp_styles);echo "</pre>";
// returns:
WP_Styles Object
(
[base_url] => http://wphierarchy.dev
[content_url] => http://wphierarchy.dev/wp-content
[default_version] => 4.1.5
[text_direction] => ltr
/* EXAMPLE CUSTOM LOOP (WPQUERY) WITH PAGINATION
function video_testimonial_loop() {
$per_page = 8;
$paged = get_query_var( 'page' );
$args = array (
'post_type' => 'defunktnutestimon',
'posts_per_page' => $per_page,
'paged' => $paged,
'meta_query' => array(
function setup_custom_rules () {
add_filter( 'rewrite_rules_array','brabo_insert_rules' );
brabo_flush_rules();
}
function brabo_insert_rules( $rules ) {
$newrules = array();
$newrules['^testsortable'] = 'index.php?ba=testsortable';
$combined_rules = $newrules + $rules;