[Resolved] Archives title and items template

Home Forums Support [Resolved] Archives title and items template

Home Forums Support Archives title and items template

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1538756
    David

    Hi,
    Thanks in advance for your time!
    I need to change the title of the CPT archive page from “Archives CPT” to “CPT” only.

    And I need to design the way a post is showed in archive page. Now only shows the post title and the page is 100% width, so there is no any template working. How can I edit the CPT page template and the posts with photo, title and other data in archive page?
    Thank you very much.

    #1538777
    David
    Staff
    Customer Support

    Hi there,

    how have you created the CPT and its accompanying templates ?

    #1538781
    David

    Hi, thanks for the quick response!

    The CPT is created and the CPT content is shown through a hook (generate_after_entry_content) with your Elements plugin. So I have’nt need to create template files yet.

    #1539470
    Tom
    Lead Developer
    Lead Developer

    Where is the Archives CPT title coming from? Any chance you can link us to the page?

    When it comes to designing your post type, it really depends on your needs. You will likely want to create a custom template file for it.

    #1540407
    David

    Hi, thanks!
    I have resolved the title question.

    The archive of the custom post type you can see it here:
    https://www.ihelp.org.es/new/reto/

    I have created the archive-reto.php copying it from archive.php file and saving it in child theme. But there is no design of the archives pages. Do I have to create it from blank or there is anyway to copy-past a design of GeneratePress?

    Thanks very much 🙂

    #1541429
    Tom
    Lead Developer
    Lead Developer

    It’s actually using the same HTML markup and CSS as our regular archives. However:

    1. It’s full width because of this custom CSS:

    body .grid-container {
        max-width: 100%;
        padding-top: 0px;
        padding-bottom: 0px;
    }

    2. The posts have no content/excerpt.

    3. The posts have no featured images.

    If you were to resolve the above, the layout should be identical to the regular archives.

    #1541544
    David

    Hi Tom, thansks!
    Perfect, now I understand the problem
    One last answer, in archive.php exists this line of code: generate_do_template_part( ‘archive’ );
    Where is the code of this ‘archive’? I think that this would be useful to create several templates files with ‘archive-CPT’ and organize them.
    Regards!

    #1542707
    Tom
    Lead Developer
    Lead Developer

    That code is a wrapper for this: https://github.com/tomusborne/generatepress/blob/3.0.2/inc/theme-functions.php#L587

    In your case, you can just replace it if needed like this:

    get_template_part( 'content', 'something' );

    #1543891
    David

    Ok, thanks Tom!

    #1544882
    Tom
    Lead Developer
    Lead Developer

    No problem!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.