whether a template can be provided for index.php?
There’s no built-in capability for selecting a custom template for archives.
How can i provide option for full width, sidebarleft& sidebarright options for index.php?
You can add a generic Customizer control with options for which template to use for archives, then inside index.php you would just check the saved value of that control with get_theme_mod()
and change the template accordingly, or include another template file, for example:
switch ( get_theme_mod( 'layout' ) ) {
case 'fullwidth':
get_template_part( 'index', 'fullwidth' );
break;
case 'sidebarleft':
get_template_part( 'index', 'sidebarleft' );
break;
case 'sidebarright':
get_template_part( 'index', 'sidebarright' );
break;
}
Related Posts:
- How to move page templates to custom folder?
- Is it possible to manipulate the list of page templates?
- Returning Variables back into a template
- Where can I access my custom page template?
- Disable front-page.php template
- Single Page theme [closed]
- Move default page templates to sub directory
- Load sidebar template just once to prevent multiple animations
- Need help with adding templates (archives and sitemap) to WordPress child theme
- Templates dropdown not appearing using _s theme (underscores)
- How to show children pages as array
- Create a variable with string, array or multiple values
- What is the point of using the front-page.php template? [closed]
- What’s the difference between home.php and index.php?
- Custom single template for a specific category
- How to insert a logo in the header?
- How to move page template files like page-{slug}.php to a sub-directory?
- Is it possible to stop selected plugins from loading on certain template pages?
- Page template in two level deep folder
- Create “File-less” Page Template in Functions.php
- Different wordpress 404 template for different post type [duplicate]
- Adding items to page template dropdown on Page Edit Screen
- How does WordPress decide what template to use as frontpage
- How can I get wp_head() as a string instead of echoing it?
- Why does my short code get executed before other content?
- Retrieve the template directory URI via global or get_template_directory_uri() every time?
- Adding Content Areas to Custom Page Template
- How can I see what template parts are being called for rendering the viewable page?
- Add a preview to a WordPress Control Panel
- Add a #hash to the links in my custom menu
- Problems with Layout inherit in theme.json
- Trouble with conditional tags
- How to Handle CSS for Multiple Header header.php Files?
- How to load different CSS in different Header?
- Static Front Page problem
- Pagination & get_pages?
- Can not Remove Archives and Meta from Sidebar
- Page attribute template dropdown not displayed even the syntax is correct
- How to override BuddyPress 3.0 bp-nouveau theme files?
- Setting hero/splash section as a blog post
- Where is the correct place(s) in twentysixteen’s header.php to add a Google webfont?
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Do I really need the div class entry?
- Any tag pagination page (except the 1st page) loads index.php template instead of tag.php
- Switching between custom templates in a post type of the admin menu
- How do I update WooCommerce template files in my theme? [closed]
- Page template across themes
- New template, where to place CSS?
- Check if password protected post is visible
- get_query_var() and permalinks
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- Toggle Sidebar Display
- Add theme templates for child categories into the template hierarchy
- Move theme templates to subfolder without losing page associations
- Theme development question regarding layouts
- Why are theme templates organized as multiple point of entry PHP files instead of reusing your theme’s index.php?
- WordPress page templates in a directory
- WordPress Theme Development: How to redirect templates the right way?
- How do I create a custom partial / template?
- Can I show all the template files that are being used on my site?
- Change the template of multiple multisite pages at the same time
- Implement content-nosidebar.php / content-leftsidebar.php
- get_page_template returning nothing
- Load child template based on parent
- Multiple Page Templates & CSS
- How to enable template page only for a post id page
- create-guten-block in wordpress theme?
- Highest number of WordPress Custom Page Templates?
- Override template file i subfolders
- Can Page Templates be Applied to Archive and Post Templates?
- Custom metabox for custom page template
- Why is the Page Template dropdown menu using the wrong file name?
- How to add “Template” option in page attributes panel?
- Single page site with history.js
- Do i need to keep all the default WP templates files in a theme?
- How can I detect hierarchal relationships beyond children (grandchild, great-grandchild, etc)?
- how to display search term in the template full site editor
- How to create a custom page(not a template) in a theme
- Sort wp_query by sum of two meta fields
- How to override p2 breathe theme plugin in content template file?
- Template selection area is not visible on page editor sidebar in wordpress twentty sixteen default theme
- Custom page template with custom fields
- What can I use for small text when converting to WordPress?
- how to setup custom content structures
- How to use get_template part in the plugin?
- Where to place template files?
- How can I conditionally show different home page templates based on whether or not the user is logged in?
- How to create a template for Pages?
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- How do I get the trackback count of a post in wordpress without writing an SQL query?
- Replace single_template filter with what for default posts?
- How to create first post, fifth post full width, rest in three columns and so on
- Template for landing pages
- Unique design inside a specific category’s url
- How to seperate static phrases from template files in custom theme?
- Issue On Displaying Pages with Post Name Permalink
- Why in the static pages of my theme are showing these information?
- Broken theme, template is missing
- How to add menù section to my WordPress template?
- Post and page content not displaying in search results