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( 'save_post', 'be_div_shortcode_filter', 10, 2 ); | |
function be_div_shortcode_filter( $post_ID, $post ) { | |
// Make sure we're on the actual post, not a revision | |
if( wp_is_post_revision( $post ) ) | |
return; | |
// Filter the content through the dean_is_awesome function that converts |
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 | |
// in functions.php | |
// Find URL in post | |
function be_find_url( $content ) { | |
preg_match( '|href=["]([^\'^"]+)["]|mi', $content, $m ); | |
return $m[1]; | |
} | |
// Redirect single posts to linked URL |
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: Display Posts Shortcode | |
* Plugin URI: http://www.billerickson.net/shortcode-to-display-posts/ | |
* Description: Display a listing of posts using the [display-posts] shortcode | |
* Version: 1.6 | |
* Author: Bill Erickson | |
* Author URI: http://www.billerickson.net | |
* | |
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
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 | |
/** | |
* Customize opening outer markup of Display Posts Shortcode | |
* @see https://displayposts.com/2019/01/04/use-section-element-for-wrapper/ | |
* | |
* @param $output string, the original opening markup | |
* @return $output string, the modified opening markup | |
*/ | |
function be_display_posts_open( $output, $atts, $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
<?php | |
/** | |
* Create Metaboxes | |
* | |
* @link http://www.billerickson.net/wordpress-metaboxes/ | |
* @param array | |
* @return array | |
* | |
*/ |
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
Index: lib/admin/inpost-metaboxes.php | |
=================================================================== | |
--- lib/admin/inpost-metaboxes.php (revision 227) | |
+++ lib/admin/inpost-metaboxes.php (working copy) | |
@@ -22,7 +22,7 @@ | |
function genesis_add_inpost_seo_box() { | |
foreach ( (array)get_post_types( array( 'public' => true ) ) as $type ) { | |
- if ( post_type_supports( $type, 'genesis-seo' ) || $type == 'post' || $type = 'page' ) { | |
+ if ( post_type_supports( $type, 'genesis-seo' ) ) { |
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
<item> | |
<title><?php the_title_rss() ?></title> | |
<link><?php the_permalink_rss() ?></link> | |
<comments><?php comments_link_feed(); ?></comments> | |
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> | |
<dc:creator><?php the_author() ?></dc:creator> | |
<?php the_category_rss('rss2') ?> | |
<guid isPermaLink="false"><?php the_guid(); ?></guid> | |
<?php if (get_option('rss_use_excerpt')) : ?> |
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
Otto: | |
Step 1: Just try it as is and see what happens. WordPress's canonical | |
redirection is pretty darned clever in some ways, and it often can | |
guess the right thing to serve out of the box. | |
Step 2: If the built in canonical redirection isn't able to detect and | |
redirect accordingly, then you can add your own code to discover and | |
handle the redirections. The way you do this is with the | |
redirect_canonical 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 Author to Display Posts Shortcode plugin | |
* @author Bill Erickson | |
* @link http://wordpress.org/extend/plugins/display-posts-shortcode/ | |
* | |
* @param $output string, the original markup for an individual post | |
* @param $atts array, all the attributes passed to the shortcode | |
* @param $image string, the image part of the output | |
* @param $title string, the title part of the output |
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 | |
/** | |
* Blog Rewrite Endpoint | |
* Used for filtering blog posts. Ex: most comments | |
* | |
* @since 1.0 | |
*/ | |
function be_add_blog_rewrite_endpoint() { | |
add_rewrite_endpoint( 'filter', EP_ALL ); |