Skip Navigation

[Fermé] Adding search results page into layouts

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 8 réponses, has 2 voix.

Last updated by Luo Yang Il y a 7 années et 5 mois.

Assigned support staff: Luo Yang.

Auteur
Publications
#214960

Hi, I am trying to add the search results views archive and either im doing something wrong or there is a problem as no matter what i do I can't get it to load the results onto a custom layout.

#215071

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hi jasonF,

Could you describe more details for the question?
Are you going to style the archive page format, please try Views WordPress Archive:
Customizing Archive Pages with WordPress Archives
https://toolset.com/documentation/user-guides/normal-vs-archive-views/

#215263

The problem is that I can't display wordpress archives or product categories in a custom layout, so i have looked at categories and search.php and I have been able to add custom layout to the page but i need to add widgets to the area.

These links demonstrate:

hidden link ( this is a custom layout with widgets in the headerbar.

hidden link ( I can't add a layout to this so i have edited search.php in order to allow consistent layout)

the second link doesn't have a widget area and I need to find a way of adding a widget area code into the php - is this possible or can you help me to get the search results, categories and product categories to display in a layout?

Thanks.

#215371

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the details, I have put it into our to-do list as a feature request.

Currently I suggest you try create custom theme files for categories archive pages and search result pages, and put the sidebar/widget into it
Template file used to render a Category Archive Index page

category-{slug}.php - If the category's slug were news, WordPress would look for category-news.php
category-{id}.php - If the category's ID were 6, WordPress would look for category-6.php
category.php
archive.php
index.php
https://codex.wordpress.org/Template_Hierarchy#Category_display

Search Result display

Template file used to render a Search Results Index page

search.php
index.php
https://codex.wordpress.org/Template_Hierarchy#Search_Result_display

#215402

I am editing the search.php, how would i add a widget area to this?

#215409

My mistake, I am editing the header.php file which I have managed to construct almost identically to my custom layout but how would I add a widget area to the header?

#215685

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Please try wordpress function get_sidebar()
http://codex.wordpress.org/Function_Reference/get_sidebar

#215802

Hi, Thanks for the info, I tried it and it didn't change anything.

#217053

Luo Yang
Supporter

Languages: Anglais (English ) Chinois simplifié (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

It is depends on your theme file, could you create a test site and fill below private details box with the login details, also point out the problem widget and sidebar, I need test in a live website.

Le sujet ‘[Fermé] Adding search results page into layouts’ est fermé à de nouvelles réponses.