Viewing 2 replies - 1 through 2 (of 2 total)
  • Julian_Kingman

    (@julian_kingman)

    OK, go to Dashboard>Plugins>Installed Plugins and click edit on Post Content Shortcodes.

    Edit this file: post-content-shortcodes/class-post-content-shortcodes.php

    Find this text:

    $this->defaults = apply_filters( 'post-content-shortcodes-defaults', array(
    				'id'			=> 0,
    				'post_type'		=> 'post',
    				'order'			=> 'asc',
    				'orderby'		=> 'post_title',
    				'numberposts'	=> -1,
    				'post_status'	=> 'publish',
    				'offset'		=> null,
    				'category'		=> null,
    				'include'		=> null,
    				'exclude'		=> null,
    				'meta_key'		=> null,
    				'meta_value'	=> null,
    				'post_mime_type'=> null,
    				'post_parent'	=> null,
    				/* Non-standard arguments */
    				'exclude_current'=> true,
    				'blog_id'		=> $blog_id,
    				'show_image'	=> false,
    				'show_excerpt'	=> false,
    				'excerpt_length'=> 0,
    				'image_width'	=> 0,
    				'image_height'	=> 0,
    				'show_title'    => false,
    				'show_author'   => true,
    				'show_date'     => true,
    				/* Added 0.3.3 */
    				'show_comments' => false,
    				'read_more' => false,
    				'shortcodes' => false,
    			) );

    And change show_author and show_date to true (as in the code above). For some reason these options aren’t available from the shortcode.

    Plugin Author Curtiss Grymala

    (@cgrymala)

    Please don’t edit the actual plugin files. Those parameters are all passed through a filter, specifically so that you don’t have to edit the plugin file.

    Instead, use the following:

    add_filter( 'post-content-shortcodes-defaults', 'custom_pcs_show_date_and_author' );
    function custom_pcs_show_date_and_author( $defaults=array() ) {
        $defaults['show_date'] = true;
        $defaults['show_author'] = true;
    }

    Secondly, if the show_date and show_author parameters aren’t working properly in the shortcode, that’s probably a bug that I’ll have to investigate. You should be able to just use:

    [post-content show_date=1 show_author=1]

    or

    [post-list show_date=1 show_author=1]

    Are you trying to use it in the post-content shortcode or the post-list shortcode? Are you using the latest version of the plugin? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Post Content Shortcodes] Date and author pulled in’ is closed to new replies.