Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The template for displaying pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages and that
* other "pages" on your WordPress site will use a different template.
*
* @package WordPress
* @subpackage Twenty_Sixteen
@sareiodata
sareiodata / gist:49949cea584f55326823
Last active March 22, 2016 07:55
bbpress close all topics
/*
* Close all bbpress topics
*/
/**
* Hook into 'the_posts' and check the topic status on single topic pages. If
* the topic is not closed, set it to closed.
*
* @since 0.1.0
*
@sareiodata
sareiodata / tpl-blank-page.php
Last active March 21, 2024 08:29
Empty WordPress page template
<?php
/**
* Template Name: Blank Template
*
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
javascript:(function(){var request=new XMLHttpRequest();request.open("GET",window.location.href.replace(/ro\//g,'hu/'),false);request.send(null);var hidden=document.body.appendChild(document.createElement("div"));hidden.style.display="none";hidden.innerHTML=request.responseText;price=hidden.querySelector('#schemaProductPrice');if(price){price=parseInt(hidden.querySelector('#schemaProductPrice').textContent.replace(/\./gm,''));price=(price*1.41/100).toFixed(2)+" lei ( "+price+" HUF )";}else{price="N/A";}price_hu=document.createElement("div");price_hu.innerHTML=price;refNode=document.querySelector('#price1');refNode.parentNode.insertBefore(price_hu,refNode.nextSibbling);})()
// Ascii code for comma
&#44;
Options: one-with-comma,two,three,four
Labels: One with &#44;,Two, Three, Four
<?php
$home_slider_option = get_option('home_page_slides');
foreach( $home_slider_option as $key => $cpt){
$id = $cpt['projects'];
$post = get_post( $id );
$title = $post->post_title;
// Project Metabox
$year = get_cfc_field( 'project_metabox', 'year', $id);
$status = get_cfc_field( 'project_metabox', 'status', $id);
### Begin System Info ###
-- Site Info
Site URL: http://www.cozmoslabs.com
Home URL: http://www.cozmoslabs.com
Multisite: No
-- User Browser
@sareiodata
sareiodata / export-users-to-csv.php
Created October 21, 2014 13:33
Modified export-users-to-csv.php to support unapproved users
<?php
/**
* @package Export_Users_to_CSV
* @version 1.0.0
*/
/*
Plugin Name: Export Users to CSV
Plugin URI: http://wordpress.org/extend/plugins/export-users-to-csv/
Description: Export Users data and metadata to a csv file.
Version: 1.0.0
<?php
function wppb_check_for_unapproved_user($data, $what){
$retArray = array( 0 => '', 1 => '');
$retMessage = '';
$messageNo = '';
$wppb_generalSettings = get_option( 'wppb_general_settings' );
if( $wppb_generalSettings['adminApproval'] == 'yes' ){
if ( $what == 'user_email' )
$user = get_user_by( 'email', $data );
// List Custom Post Types in category and tags archives
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if(is_category() || is_tag()) {
$post_type = get_query_var('post_type');
if( ! empty( $post_type ) ){
$post_type = array_merge(array('post','VisualsWshortText', 'longTextWvisuals', 'TxtwAncillaryVisuals'), $post_type );
} else {
$post_type = array('post','VisualsWshortText', 'longTextWvisuals', 'TxtwAncillaryVisuals');