Skip to content

Instantly share code, notes, and snippets.

View chrisdigital's full-sized avatar

Chris Carvey chrisdigital

View GitHub Profile
@chrisdigital
chrisdigital / WP_query a custom posttype
Created October 14, 2012 21:03
Using wp_query to pull all entries under a custom post type
<ul> <?php
$args3 = array(
'post_type' => array( 'investigators' ), //set post type
'post_status' => 'publish', // only pull published
'field' => 'slug', //searching on slug field
'orberby' => 'name', //order by name *ignored if using custom order by plugin, set in admin*
'order' => 'DESC', //in descending order
'posts_per_page'=> '-1', //show all
//- - - - - - - - - - - - -
@chrisdigital
chrisdigital / Custom WP_query with custom post type, taxonomy and tag filtering
Created October 13, 2012 19:18
How to do a custom wp_query in wordpress with a custom post type , taxonomy and tags
```php
<?php
$args1 = array(
//choose what post type you want to pull from
'post_type' => array( 'news' ),
//speed up query by only grabbing published items
'post_status' => 'publish',
//drill down into postype with a specific taxonomy via a tax_query
'tax_query' => array(
@chrisdigital
chrisdigital / Wordpress global find and replace in SQL
Last active October 11, 2015 14:48
Find and replace string in MYPHPAdmin in Wordpress SQL tables
Wordpress global find and replace in SQL
//Source: Global Find and Replace In Wordpress using MySQL | Barry Wise NJ SEO and Marketing Consultant
//http://www.barrywise.com/2009/02/global-find-and-replace-in-wordpress-using-mysql/
//http://stackoverflow.com/questions/7548964/sql-find-and-replace-text
//http://stackoverflow.com/questions/421227/sql-to-search-and-replace-in-mysql
//http://tdot-blog.com/wordpress/6-simple-steps-to-change-your-table-prefix-in-wordpress
UPDATE wp_posts SET post_content = REPLACE(post_content, 'staging.server.com', 'www.productionserver.com');
UPDATE [your_table_name] SET [your_table_field] = REPLACE([your_table_field], '[string_to_find]'
@chrisdigital
chrisdigital / Java Parameters
Created September 3, 2012 23:10
How to turn java on in your demo study
p = private('_params'); p.skip_java=false; p.skip_webcam_setup=false;
@chrisdigital
chrisdigital / sticky-element
Created July 16, 2012 16:39
This is modified code to work with mootools to use variables in the sticky element code and give flexibility to the selector being targeted.
// Scrolling sidebar for your website
// Downloaded from Marcofolio.net
// Read the full article: http://www.marcofolio.net/webdesign/create_a_sticky_sidebar_or_box.html
// This has a mootools.js dependency
// Modified by Chris Carvey Eyetrackshop, Inc.
window.onscroll = function()
{
///////////// Variables ///////////////
//Change selector and these numbers....
@chrisdigital
chrisdigital / unix-find-string-then-move
Created July 15, 2012 18:59
Find files, by string in file names, in current directory, then move the files to another directory you've already created - bash command
sudo find . -name "string-in-filename-goes-here" -exec mv {} ~/full/destination/path/goes/here/in/your/user/folder \;
@chrisdigital
chrisdigital / study-stumuli-css
Created July 13, 2012 23:48
CSS styles for study stimuli
body {
background:#fff;
}
.base-wrapper{
position:absolute;
z-index:10;
}
.content-wrapper {
@chrisdigital
chrisdigital / deactivate-links-onclicks
Created July 13, 2012 23:34
Deactivate all links and remove onclick events with JQuery