Joined April 2012
·

Austin Ginder

Web Developer at Anchor Hosting
·
Lancaster, PA
·
·
·

This article is a bit outdated. Now of days, I use ACF to generate custom fields + http://generatewp.com/post-type/ to generate the custom post type.

To answer your question, instead of using a page template you could adapt the code into a taxonomy page. Maybe taxonomy-pdf_category.php. Then in that page you could let WordPress setup the loop for you by using a standard loop like so.

<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>


<?php endwhile; ?>

Since the only thing I'm storing is the full url to the file, you would have to use some fancy PHP to extract the file name and file size from that.

This solution is a bit outdated now. I would recommend using Advanced Custom Fields plugin: http://www.advancedcustomfields.com/. ACF is powerful. I use it on every website I build. When using ACF with files, look here for a code example: http://www.advancedcustomfields.com/resources/field-types/file/. With this example you would do something like:

// retrieve file size
echo filesize( get_attached_file( get_field('file')) );

// retrieve file name
echo basename ( get_attached_file( get_field('file')) );
Posted to Wordpress Custom Post Type Slider over 1 year ago

The Nivo Slider is responsive out of the box. You might need to tweak some css in your layout. A good place to start would be by looking at the code on the Nivo Slider demo page: http://demo.dev7studios.com/nivo-slider/.

Posted to Gmail backup to Dropbox over 1 year ago

Thanks for the tip.

A few months ago I switched to online service call CloudHQ, https://www.cloudhq.net. I am no longer running the backup script. In addition backing up Gmail, it's also backing up my Evernote and Google Drive to Dropbox.

@marcez Sure thing. Glad I was able to help.

@marcez Marc,

There could be a couple reasons for this. One thing I didn't mention was the css styling I was using. Without the proper css the links won't appear colored. Another thing to look at is the categories. In my "index-fact-sheets.php" I'm specifically targeting the post that have the pdf_category set to 'fact-sheets'. In your backend go to "PDF Resource" and select "Categories". Make sure you have a something in the respective categories. Here is what my backend screen looks like: http://cl.ly/image/0G1C1R2b3L3F. If you still have problems, feel free to contact me directly.

Austin

Achievements
605 Karma
52,617 Total ProTip Views
Interests & Skills