A Pen by Julian Garnier on CodePen.
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
/* source -- https://wordpress.org/plugins/piwigopress/#faq */ | |
.PiwigoPress_photoblog { | |
display:inline-block; | |
} | |
.PWGP_shortcode { | |
display:inline-block; | |
} |
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_filter( 'all_plugins', 'hide_plugins'); | |
function hide_plugins($plugins) | |
{ | |
// Hide hello dolly plugin | |
if(is_plugin_active('hello.php')) { | |
unset( $plugins['hello.php'] ); | |
} | |
// Hide disqus plugin |
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 hide_update_notice_to_all_but_admin_users() | |
{ | |
if (!current_user_can('update_core')) { | |
remove_action( 'admin_notices', 'update_nag', 3 ); | |
} | |
} | |
add_action( 'admin_notices', 'hide_update_notice_to_all_but_admin_users', 1 ); |
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
add_filter('the_content_feed', 'rss_post_thumbnail'); | |
function rss_post_thumbnail($content) { | |
global $post; | |
if( has_post_thumbnail($post->ID) ) | |
$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content; | |
return $content; | |
} |
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
<!-- I discussed this function during the lightning round at WordCamp San Diego 2013. | |
add_feed() adds a custom feed to your WordPress site. I discovered this function recently when I needed to create a feed that | |
uses a custom query. Specifically, a client needed a feed that pulled together content in a single category from multiple | |
custom post types. The default WordPress category feeds will not pull content from multiple custom post types. The code below | |
can be dropped into functions.php in your theme folder or it could be rolled into a plugin. --> | |
add_feed( 'games' , 'make_games_feed' ); | |
function make_games_feed(){ | |
$args = array( |
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
<!-- add tp wp-config.php --> | |
define( 'FS_METHOD', 'direct' ); | |
define( 'FS_CHMOD_DIR', 0755 ); | |
define( 'FS_CHMOD_FILE', 0755 ); |
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
class InsertAnchors { | |
protected $count = 0; | |
protected $links = ''; | |
public function build( $pattern, $content ) { | |
$this->count = 0; | |
$this->links = ''; | |
$content = preg_replace_callback( $pattern, array( $this, '_replacer' ), $content ); | |
return '<p>' . $this->links . '</p>' . $content; | |
} | |
public function _replacer( $matches ) { |
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 | |
$pages = get_pages('child_of='.$post->ID.'&sort_column=post_title'); | |
$count = 0; | |
foreach($pages as $page) | |
{ ?> | |
<a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a> | |
<?php | |
} | |
?> |
NewerOlder