This file contains 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
/* | |
https://css-tricks.com/perfect-full-page-background-image/ | |
*/ | |
.jumbotron { | |
height: 800px; | |
background: url('https://s3.amazonaws.com/codecademy-content/projects/broadway/bg.jpg') no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; |
This file contains 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 | |
// define the wpcf7_mail_components callback | |
function filter_wpcf7_mail_components( $components, $number ) | |
{ | |
/* | |
$components = compact( 'subject', 'sender', 'body', | |
'recipient', 'additional_headers', 'attachments' ); | |
*/ | |
// make filter magic happen here... | |
$components[ 'subject' ] = 'New subject changed in filter'; |
This file contains 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( 'admin_init', 'wpse_136058_debug_admin_menu' ); | |
function wpse_136058_debug_admin_menu() { | |
// position $value[ 2 ] is the menu slug | |
echo '<pre>' . print_r( $GLOBALS[ 'menu' ], TRUE) . '</pre>'; | |
} |
This file contains 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
# reference: http://subharanjan.com/sql-query-to-get-post-and-its-meta_values-as-one-row-of-record-single-data-grid/ | |
# ONLY USERS/POSTS WITH VALUES | |
SELECT wp_posts.ID, wp_posts.post_title, pm1.meta_value as field1, pm2.meta_value as field2, pm3.meta_value as field3 | |
FROM wp_posts | |
LEFT JOIN wp_postmeta AS pm1 ON (wp_posts.ID = pm1.post_id AND pm1.meta_key='metakey1') | |
LEFT JOIN wp_postmeta AS pm2 ON (wp_posts.ID = pm2.post_id AND pm2.meta_key='metakey2') | |
LEFT JOIN wp_postmeta AS pm3 ON (wp_posts.ID = pm3.post_id AND pm3.meta_key='metakey3') | |
WHERE wp_posts.post_type = 'post' | |
AND wp_posts.post_status = 'publish' | |
AND ((pm1.meta_key = 'metakey1') OR (pm2.meta_key = 'metakey2') OR (pm3.meta_key = 'metakey3')) |
This file contains 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 | |
// upload this file in the same directory where wordpress index.php is. | |
// load this file in a browser. | |
ini_set('display_errors','1'); | |
ini_set('display_startup_errors','1'); | |
error_reporting (E_ALL); | |
include('index.php'); |
This file contains 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
<form action="<? bloginfo('url'); ?>" method="get"> | |
<select name="page_id" id="page_id"> | |
<?php | |
global $post; | |
$args = array( 'numberposts' => -1); | |
$posts = get_posts($args); | |
foreach( $posts as $post ) : setup_postdata($post); ?> | |
<option value="<? echo $post->ID; ?>"><?php the_title(); ?></option> | |
<?php endforeach; ?> | |
</select> |
This file contains 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
[xdebug] | |
xdebug.remote_enable = 1 | |
xdebug.remote_host = 10.0.2.2 #vagrant | |
xdebug.remote_port = 9000 | |
xdebug.remote_handler = dbgp | |
xdebug.remote_mode = req |
This file contains 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
PM> Install-Package OpenCV.Net -Source http://168.62.110.126/api/v2 |
This file contains 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( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); | |
function theme_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'child-style', | |
get_stylesheet_directory_uri() . '/style.css', | |
array('parent-style') | |
); | |
} |
This file contains 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 | |
/** | |
* | |
* http://www.computersolutions.cn/blog/2013/01/custom-taxonomies-in-wordpress-and-qtranslate-translation-problem-resolution/ | |
* | |
* Works with mqTranslate, qTranslate | |
* | |
*/ | |
function qtranslate_edit_taxonomies(){ | |
$args=array( |