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
$out = ''; | |
$page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; | |
$args = array( | |
'post_type' => 'page', | |
'posts_per_page' => '100', | |
'paged' => $page | |
); | |
// The Query | |
$the_query = new WP_Query( $args ); |
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
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; | |
filter: alpha(opacity=50); | |
-moz-opacity:0.5; | |
-khtml-opacity: 0.5; | |
opacity: 0.5; |
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
/* | |
* originally by http://core.trac.wordpress.org/ticket/15311 | |
* updated for WP 3.5 by me, who else :) | |
* Resize images dynamically using wp built in functions | |
* Victor Teixeira | |
* | |
* php 5.2+ | |
* | |
* Exemplo de uso: | |
* |
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 global $post; | |
$g_args =array( | |
'post_parent' => $post->ID, | |
'post_status' => 'inherit', | |
'post_type' => 'attachment', | |
'post_mime_type' => 'image', | |
'order' => 'ASC', | |
'orderby' => 'menu_order' | |
); |
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
// cleaner | |
// credits http://wordpress.stackexchange.com/questions/52097/better-way-to-remove-html-syntax-from-all-content | |
$tochange = get_posts('post_type=product&numberposts=-1'); | |
foreach ($tochange as $post): | |
setup_postdata($post); | |
$changed = array(); | |
$changed['ID'] = $post->ID; | |
$changed['post_content'] = strip_tags($post->post_content, '<img><a>'); // post_excerpt | |
print_r($post->ID); |
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 get_id_by_title($title){ | |
global $wpdb; | |
$p = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = $title"); | |
return $p; | |
} |
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
$img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' ); |
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
// picture ids: array(1, 2, 3) | |
// $queries = array( | |
// array('large_screens','min-width: 1450px'), | |
// array('medium','max-width: 480px'), | |
// array('large','') | |
// ); | |
// $class = class | |
function responsive_picture2($id, $class, $queries){ | |
$with_euery = ''; | |
$without_euery = ''; |
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
// picture ids: array(1, 2, 3) | |
// $queries = array( | |
// array('large_screens','min-width: 1450px'), | |
// array('medium','max-width: 480px'), | |
// array('large','') | |
// ); | |
function responsive_background_pictures($id_array, $queries){ | |
$with_euery = ''; | |
$without_euery = ''; | |
// for each style resolution |
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', 'register_my_post_type' ); | |
/** | |
* Register a type post type. | |
* | |
* @link http://codex.wordpress.org/Function_Reference/register_post_type | |
*/ | |
function register_my_post_type() { | |
$labels = array( | |
'name' => _x( 'types', 'post type general name', 'your-plugin-textdomain' ), |
OlderNewer