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_filter( 'pre_get_posts', 'my_get_posts' ); | |
function my_get_posts( $query ) { | |
if ( is_home() && $query->is_main_query() ) | |
$query->set( 'post_type', array( 'post', 'wprss_feed_item', ) ); | |
return $query; | |
} |
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
application: YOUR_PROJECT_IDversion: wpruntime: phpapi_version: 1handlers:- url: /(.*\.(htm$|html$|css$|js$)) static_files: wordpress/\1 upload: wordpress/(.*\.(htm$|html$|css$|js$)) application_readable: true- url: /wp-content/(.*\.(ico$|jpg$|png$|gif$)) static_files: wordpress/wp-content/\1 upload: wordpress/wp-content/(.*\.(ico$|jpg$|png$|gif$)) application_readable: true- url: /(.*\.(ico$|jpg$|png$|gif$)) static_files: wordpress/\1 upload: wordpress/(.*\.(ico$|jpg$|png$|gif$))- url: /wp-admin/(.+) script: wordpress/wp-admin/\1 secure: always- url: /wp-admin/ script: wordpress/wp-admin/index.php secure: always- url: /wp-login.php script: wordpress/wp-login.php secure: always- url: /wp-cron.php script: wordpress/wp-cron.php login: admin- url: /xmlrpc.php script: wordpress/xmlrpc.php- url: /wp-(.+).php script: wordpress/wp-\1.php- url: /(.+)?/? script: wordpress/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
<?php | |
/* | |
Plugin Name: Aggressivex Network Custom Post | |
Version: 1.0 | |
Author: Luis Muñoz | |
Author URI: http://www.aggressivex.com/author/luis.munoz/ | |
*/ | |
class AN_custom_post | |
{ | |
var $post_type_name = 'product'; |
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 | |
/* | |
GeoRSS formatted output for Google Maps | |
Authors: Alastair Mucklow, Chris Toppon | |
*/ | |
//header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true); | |
//$more = 1; | |
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'" standalone="yes"?'.'>'; ?> |
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 | |
$the_slug = 'my-slug'; | |
$args=array( | |
'name' => $the_slug, | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => 1 | |
); | |
$my_posts = get_posts( $args ); | |
if( $my_posts ) { |
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 | |
$args = array( | |
'post_type' => 'attachment', | |
'numberposts' => -1, | |
'post_status' => 'any', | |
'post_parent' => $post->ID, | |
'exclude' => get_post_thumbnail_id() | |
); |
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 | |
include_once(ABSPATH . WPINC . '/feed.php'); | |
$rss = fetch_feed('https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=catswhocode'); | |
$maxitems = $rss->get_item_quantity(3); | |
$rss_items = $rss->get_items(0, $maxitems); | |
?> | |
<ul> | |
<?php if ($maxitems == 0) echo '<li>No items.</li>'; | |
else |
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
function twtreplace($content) { | |
$twtreplace = preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/',"$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>",$content); | |
return $twtreplace; | |
} | |
add_filter('the_content', 'twtreplace'); | |
add_filter('comment_text', 'twtreplace'); |
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
function wps_trend($atts){ | |
extract( shortcode_atts( array( | |
'w' => '500', // width | |
'h' => '330', // height | |
'q' => '', // query | |
'geo' => 'US', // geolocation | |
), $atts ) ); | |
//format input | |
$h=(int)$h; | |
$w=(int)$w; |
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 | |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
if(is_plugin_active('plugin-directory/plugin-file.php')) { | |
//plugin is activated | |
} | |
?> |