WordPress.org

Forums

Custom Content Type Manager
Parse error: syntax error, unexpected $end in /home/mvanorshov (9 posts)

  1. mvanorshoven
    Member
    Posted 3 years ago #

    Hey Fireproof socks,

    I'm very new at this and am trying to test this.

    Here's the php template file

    <?php
    /**
     * Sample template for displaying single native_plants posts.
     * Save this file as as single-native_plants.php in your current theme.
     *
     * This sample code was based off of the Starkers Baseline theme: http://starkerstheme.com/
     */
    
    get_header(); ?>
    
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    And the error message is referring to the last line of php. Any thoughts?

    Thanks.

    Martha

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 3 years ago #

    What's the error? I don't see the error message in your post. Is that the full example of your single-native_plants.php file? Because I only see the first part of it... the while loop is missing the required "endloop" statement to close the loop. Did you copy the entire sample template from the example using "Select All"?

  3. mvanorshoven
    Member
    Posted 3 years ago #

    hmmm. I put this code/your code in a test site:

    here's the url: http://www.mvanpractice.com/?post_type=native_plants&p=40

    and I did copy all of your code.

    Let me know if I'm missing something or need to give you more information. Oh, and thanks for the quick response!

    Martha

  4. fireproofsocks
    Member
    Plugin Author

    Posted 3 years ago #

    Can you paste the entire sample template here? If what you pasted above is all that you pasted into the template file (or if that's all there was available), then you'll get errors because that's only half the code. Maybe there was a problem generating the sample template, but I can't debug code if I can't see it.

    The template code should look something like this:

    [Code moderated as per the Forum Rules. Please use the pastebin]

  5. mvanorshoven
    Member
    Posted 3 years ago #

    here's the code from the notepad file:

    <?php
    /**
     * Sample template for displaying single native_plants posts.
     * Save this file as as single-native_plants.php in your current theme.
     *
     * This sample code was based off of the Starkers Baseline theme: http://starkerstheme.com/
     */
    
    get_header(); ?>
    
    <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    Now... when I went to look to make sure I had the file in the correct directory, I realized that I had ftp'd this over twice. That was probably causing the error message. Dumb operator error on my part.

    That said, though, all of the fields that I defined in the custom field section are not showing up.
    These fields are: picture, latin_name, type, habitat, medicinal_uses. I am using the twenty-eleven theme.

    Any thoughts?

  6. fireproofsocks
    Member
    Plugin Author

    Posted 3 years ago #

    You could have had an FTP error that caused the file to be corrupted.

    Look at the sample I pasted above and get that onto your server. Then alter it and repeat the line there using the get_custom_field() so it uses the names of your fields: picture, latin_name, type, habitat, medicinal_uses.

  7. mvanorshoven
    Member
    Posted 3 years ago #

    Ok. Well, thus far it's all been "operator error" on my part. In going through the ftp exercise again I realized that I had NOT copied all of the template file over. It is all copied over now and it's all working except the jpg file.

    Indian Ricegrass practice
    Indian Ricegrass grows in the Great Basin, the Mojave and Colorado deserts, and Chaparral of southern California. It is an important forage in these areas and has suffered greatly from overgrazing. This graceful, densely tufted bunchgrass grows to about two feet high and eventually spreading to a foot wide. The stiff blades are rolled and taper to a point. The round, dark colored seeds are a quarter inch long and round to oval shaped.
    Custom Fields
    Latin Name: Achnatherum hymenoides
    Habitat: Array
    Type: Shubs and Vines
    picture: http://www.mvanpractice.com/wp-content/uploads/2011/09/indian_ricegrass.jpg
    Medicinal Uses:

  8. fireproofsocks
    Member
    Plugin Author

    Posted 3 years ago #

    You have to DO something with the output there for to see image: put that path into an img tag, e.g.

    <img src="<?php print_custom_field('my_image'); ?>" />

    There are many pages in the wiki that deal with this, so have a look there.

  9. mvanorshoven
    Member
    Posted 3 years ago #

    thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Content Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic