• I got your shortcode working right off the bat on an existing webpage (thank you) and it’s actually very close to what I need. But I imagine there not much ability to customize what the shortcode spits out on a page other than the variables listed in the FAQ.

    This means I’ll need to customize the archive-news.php file.

    Here what I need to output:

    1) Featured Image
    2) Have the featured image link to a pdf file
    2) Date
    3) Title

    I know how to do 1,3 & 4 above.

    Also, I need to list display on an existing web-page. Is that possible? Or does the listing have to have the domain.com/news url structure.

    https://wordpress.org/plugins/news-cpt/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mgwaters

    (@mgwaters)

    I should have mentioned each news item record will have an associated pdf file. I was wondering if I needed a custom field to house that, or would I upload using the WP Media Library?

    Plugin Author vanjwilson

    (@vanjwilson)

    @mgwaters,

    Glad to hear you are getting something out of the News-CPT plugin.

    As for linking a PDF, and then displaying that link, I think your best option is this:

    Install Advanced Custom Fields plugin. (https://wordpress.org/plugins/advanced-custom-fields/)
    Create a Custom Field group that only appears for news post type, and add an Image field type to that group.
    Select the appropriate PDF file as the “custom image” for each of your news items, and then when you modify the template files, use the appropriate ACF template tags to display a link to the file you selected for that item. (See http://www.advancedcustomfields.com/resources/#functions for their template tags.)

    Items 1, 3, and 4 you should be able to add to the templates with standard WordPress template tags. See http://codex.wordpress.org/Template_Tags to help find the tags you need.

    I hope this helps get you on the right track.

    As far as displaying the list on a regular WordPress page (as opposed to the automatically generated archive page), that is what the shortcode tag is for. You can use CSS to override how the output from that shortcode looks. You can even override the markup it emits by editing the output variable in the list_news_items_shortcode function of the news-ctp.php file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Fields?’ is closed to new replies.