• I am using a template that has built in functionality and I cannot figure out how a certain aspect of it works.

    There is a Custom Post Type set up already, and there is a page (https://www.mindstreamacademy.com/?page_id=499) that creates an ordered list with columns featuring excerpt and the featured image from the custom post and embeds it in the page with a “read more” button that takes you to the post itself.

    I cannot figure out how this works and I want to create another page with videos that works the same way (using custom post types and putting excerpts in columns in the page). The setting for the page are the same as every other page in the WP page editor (default template, no custom fields).

    Any ideas? Please don’t say “contact the template creator” because their service staff are comprised of morons.

Viewing 9 replies - 1 through 9 (of 9 total)
  • One possibility – look for a file named page-499.php in your theme’s folder.

    A file by that name would be used as the ‘Default’ template for a page with that ID.

    If you find it, create your new Page, copy page-499.php and change the number to the new Page ID.

    Thread Starter mattbodie

    (@mattbodie)

    I thought of that, but that file doesn’t exist in the theme folder. Does wordpress create a .php file for every page you create or is a specific page’s file stored elsewhere?

    I can look at the page source from the browser and see the code that is used to generate the page, but I cannot find it referenced in any of the theme files.

    WordPress will not create .php files – those should exist in your theme.

    Take a look at the WP Template Hierarchy diagram.

    Start at the left and trace each line that fits your case. Look for .php files that fit the patterns shown, probably with either the post-type or slug or id in the name.

    Thread Starter mattbodie

    (@mattbodie)

    OK! I think you’ve helped me narrow it down. The page has a slug “services” and there is a page-services.php file with a line:

    query_posts('post_type=why&post_status=publish&posts_per_page=6&paged='.$paged);

    I think this corresponds to the “rewrite slug” in the custom post type. Am I correct?

    If so I should just create a new custom post type for “movies”, copy the code from the page-services.php file, paste it in a new php file, and change the code to reflect the new slug?

    That sounds like it should work.

    Thread Starter mattbodie

    (@mattbodie)

    It didn’t work originally, but then I learned the valuable lesson of maintaining pluralization across all my files (I accidentally named the php file video instead of videos). Once I realized that, it totally worked!

    Thanks so much for your help. You are my savior!

    Thread Starter mattbodie

    (@mattbodie)

    Follow up question.
    I set up the .php files of both pages exactly the same, I set up the Custom Post Types exactly the same, I created the posts in exactly the same way that I created the original ones, and have gone through everything to make sure that the settings for both pages are completely identical. What results is this page which is the page that I copied from (here). And this is the result from the page that I created (here).

    Any help with what could be wrong? I’m stumped! It seems like it is a CSS issue.

    I think you are right about the CSS.

    I see a lot of style.css entries like ‘.services.name-1’, ‘.services li’, etc, but no corresponding ‘.videos.name-1’, etc.

    Thread Starter mattbodie

    (@mattbodie)

    That was it! I just copied and pasted that code in the style.css file, changed the names, and it worked great!

    Your help is a gift from above.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom Post Excerpts in Page’ is closed to new replies.