Skip Navigation

[Resolved] Add WordPress Archive Cell to a layout. Show only one specific post type.

This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by Ole Andreas Vekve 7 years, 6 months ago.

Assisted by: Konstantinos Galanakis.

Author
Posts
#447420

I am trying to add a WordPress Archive cell inside a layout.

I have made a single layout for a specific post type and added Archive at the bottom. I want this archive to only show posts from a specific post type. Currently it only shows from the standard WordPress posts.

I guess this is an easy question to solve, but I did not find any links on the forum to help me out.

Any ideas?

Looking forward to hear from you again,

#447480

Hello.

Thank you for contacting the Toolset Support.

When inside the Layout editor, try to find a section called "This layout is used for these loops". Hit the "Change how this layout is used" button, scroll down on the modal and under the section "Custom Post Archives" find the custom post type archive you want this layout to be used to and select it. Don't forget to click update. Then close the modal and save your layout.

Navigate to the archive of your custom post type to see if the layout is applied properly now.

If this doesn't resolve your issue or you have any further issues or questions, please let me know.

Regards

#447776

Hello,

Thank you for your answer.

I am in Edit layout and have selected the correct layout.

In the section "This layout is used for these posts:" I have selected two pages.

If I scroll down to Archives and change where the layout is to be used. They are used within the archives, but that is not what I want. I have already made for the archives. Now I only want to show archives inside the two pages.

This is the archive: hidden link

Here are the pages where I want the archive list to be displayed: hidden link and hidden link

Those to pages also should have the regular page title and page body etc like this: hidden link This is already set in the page template.

Best would actually be if I could insert a shortcode inside the WordPress page.

#447837

Hello .

I'm afraid you got me confused.

So the thing is that you want to create a custom post type single page layout that will be used to display all the desired information for a custom post type item. Inside that single item layout, you also want to display an archive (list of other items) of the same custom post type.

If what I'm saying is correct, then you cannot use WordPress Archives and the WordPress Archive cell. Instead, you have to create a View that lists all the items of that custom post type, the way you want. What you actually need to do is create the archive of your custom post type yourself by using Views. When you have that View ready, you can use the View Cell and choose the View you just created to appear in that position.

If this doesn't resolve your issue or you have any further issues or questions, please let me know.

Regards

#447952

Thank you,

Almost correct. The pages are standard WordPress Pages. They are not singles inside a custom post type.

I have a View ready and need to include this in the Page Templates.

The page templates looks like this:

<?php get_template_part( 'toppbilde', 'blackcover-text' ); ?>

<article class="underside">
<div class="clearfix">
    <div class="holder blacktext">
        <div class="container">
            <div class="row">
            	<div class="col-md-1"></div>
                <div class="col-md-10 textarea luftned">
                    <div class="light lightstrong">
                       <?php the_content('readmore', true); ?>
                    </div>
                </div>
                <div class="col-md-1"></div>
			</div>
        </div>
    </div>
</div>
</article>

<div class="clearfix">
    <div class="holder grey">
    	<?php the_ddlayout('default-layout'); ?>
    </div>
</div>

I am wondering if the View can be included in the

<?php the_ddlayout('default-layout'); ?>

. That would really solve my problem.

Looking forward to hear from you again,

#447970

Hello.

In order to integrate Layouts plugin with your page template please see the guide here https://toolset.com/documentation/user-guides/layouts-theme-integration/.

After the successful integration, you can insert your View inside your Layout by using the View Cell from the list of the available cells.

If you have any further issues, please let me know.

Regards

#447977

Hi again,

Problem solved by adding the View to a Layout, and then Assign to content on the individual pages.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.