WordPress.org

Ready to get started?Download WordPress

Forums

Promotion Slider
Promotion Slider Plugin Custom Template (3 posts)

  1. inhouse
    Member
    Posted 1 year ago #

    Hi, I'm wondering if it's possible to use a custom template to customize what content is used in the slider. I'd like to insert a custom field in the slider. It looks like the plugin index.php file controls the content so I'm not sure the plugin even supports custom templates. Thanks in advance.

    http://wordpress.org/plugins/promotion-slider/

  2. inhouse
    Member
    Posted 1 year ago #

    I found the my_slider_content function but am not sure how to display a custom field. i thought echoing the field would work but it's not drawing in the field. Does this need to use get_meta or get_meta_custom or something like that? My field name is "_author". Thanks again.

    function my_slider_content($values){
    extract($values);
    add_action('promoslider_content', 'promoslider_display_title', 9);
    add_action('promoslider_content', 'promoslider_extra_content');
    }
    add_action('promoslider_content', 'my_slider_content');
    function promoslider_extra_content(){
    echo mcm_custom_field('_author');
    }
  3. Micah Wood
    Member
    Plugin Author

    Posted 1 year ago #

    @inhouse,

    If you are using post meta for storage, which would be the case when using WordPress's built-in custom field functionality, then you would retrieve your data like this:

    function promoslider_extra_content() {
        global $post;
        echo get_post_meta( $post->ID,  '_author', true );
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic