• Resolved markimark3269

    (@markimark3269)


    Hi there,

    I tried everything, for 3 days now but I can not make a custom archive site working with my custom post type. The slug is “jobs” and I have created an archive file with the name archive-jobs.php. Despite I have set “has archive” to TRUE, it does not use this custom archive but the default instead.

    Is there any way to help me creating the custom archive because I need that very badly?

    Cheers

    Mark

    https://wordpress.org/plugins/custom-post-type-ui/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Do you have a place where I could see this in action?

    Could you try out this plugin to see what it shows you? http://wordpress.org/plugins/show-template/

    Ignore the warning at the top, I use it frequently, it still works fine without issues.

    Thread Starter markimark3269

    (@markimark3269)

    Hi Michael,
    thanks for trying to help me. Is there a chance that you contact me directly, because I would like to give me some credentials to make it more easy. My email is: mark@mark-i-mark.com

    Cheers

    Mark

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    create some sort of admin account for michael @ webdevstudios.com and that’ll reach me.

    Thread Starter markimark3269

    (@markimark3269)

    I will send you an email.

    Cheers

    Mark

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not sure what may have happened, but I double checked your CPTUI settings for the jobs post type, and it listed “has archive” as false.

    So I updated that to be true, and I moved a copy of archive-jobs.php into the child theme you have going. i then tested it quickly by echo’ing out content for just my user(so others wouldn’t see it), and it showed through just fine at yourdomain.com/jobs/ like expected. So I think you’re good to go at this point.

    The biggest issue was likely that setting being false accidentally.

    Thread Starter markimark3269

    (@markimark3269)

    Thank you. So the issue was that I did not drop the custom archive file in the child theme. That was because nothing else really worked when I tried to do such things within the child theme, so I did more and more changes in the main theme. I thought I can do that and that the child theme is only a good idea to save changes in case of theme updates. However, this time I should have moved the new file in the child theme.

    I can now try to modify from here because right now, it uses the default style for displaying the posts. I wanted to create a grid (3 rows) for it but maybe this is too much of a challenge, at least for me.

    Thank you for having that extra eye that is sometimes missing if working for too long on a certain project.

    Have a great evening in US.

    cheers
    Mark
    Berlin, Germany

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    The issue was that your CPT settings still had “has_archive” set to false, at least when I went in to check. Visiting domain.com/jobs/ was giving me a 404 error, which hinted at that being the primary problem. Once I set it to true and hit save, it all fell into place.

    The template file would work in both parent and child theme, and I tested that as well just to be certain. I ultimately moved it into the child theme so so it would be safe from parent theme updates.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘custom archive not working’ is closed to new replies.