Forums

Need Help coding Page w/ post (2 posts)

  1. tech.knowledG
    Member
    Posted 7 months ago #

    I am working on my first site in years and decided to use wordpress. I am trying to code a page templete .php file that would allow the page to have a steadystate opening paragraph explaining the related post that would follow.

    Here is a link to the Google Doc with what I have so far and its not delivering what i want.


    https://docs.google.com/document/d/1jZ9QkC1yDvVXcQ5sWKA7bA2es0xL2kXxpcxr0fCRCnU/edit?hl=en_US

    I looked through the WP docs and how too's and made the changes it suggested but still no luck

    any help would be greatly appreciated

  2. peredur
    Member
    Posted 7 months ago #

    One thing that looks a bit odd to me is:

    <?php if (is_page() ) {$category = get_post_meta($posts->ID, '3,4,5,6,7,8', true);}

    If it's a page, it won't be a post, so it won't have a category since only posts have categories. But maybe I'm misreading your code.

    I think I'd have done this a different way, if I understand your requirements correctly. I'd have put the posts you're interested in into a category and then put the fixed text into the category template for that category.

    I did something similar, once, for this site. The bit with the light green background at the top of the list, headed "Writing Residencies", is the fixed text.

    Cheers

    PAE

Reply

You must log in to post.

About this Topic