Suppose we registered the composers and the interprets custom taxonomies. The composers taxonomy could have the following terms: Wolfgang Amadeus Mozart Ludwig van Beethoven Richard Wagner The interprets taxonomy could have the following terms: Glenn Gould Daniel Barenboim Vienna State Opera I am wondering whether the WordPress template hierarchy has a special file , like taxonomy-terms.php, to list taxonomy terms with a simple loop: <?php while ( have_posts() ) : the_post(); the_title(); endwhile; ?> This would print (assuming the /%postname%/ …
Edit: Now I've found that this is Hybrid Core, and apparently the template hierarchy is different. I still haven't solved my problem below though. In addition to the title. My thinking is that if I am able to select a template in the backend, it should honor that selection. It doesn't change though. I've tested the other template file in place of the default, and it works. This is the function to add my custom post type. This works just …
I'm trying to create a template file for a custom taxonomy archive page but I keep getting a 404 error when trying to access that archive page. Basically something like: domain.com/quizzes/quiz-levels/ I managed to create template files for /quizzes/ and /b1-intermediate/ (or whatever the level is), but when I land on "domain.com/quizzes/quiz-levels/" I get a 404 error doesn't take any template file. What I'm aiming for is the following: domain.com/quizzes/ : To show all the quizzes (Works) domain.com/quiz-post-slug/ : To …
I have created city taxonomy in back end and i have added mumbai,pune,nashik city in city taxonomy like bellow snipe. My problem is that when i click the city for example mumbai i want display the all product in the mumbai city which i have set from the product tab means that product is in mumbai city category. I have tried with bellow code but not getting any thing. Custom Taxonomies display Template file used to render the Archive Index …
I currently have a global function in my functions.php file ein_error_log($message) { //push out $message to file... } But I want to start using it in my MU-Plugin directory and it doesn't know it exists. So I assume it's because MU-Plugins folder is read before the theme folder in WordPress's hierarchy, which makes sense. But if the hierarchy is the case, how do I distinguish which MU-Plugin runs first to make sure all other MU-Plugin files can run dependent on …
I'm a bit confused with templates for custom post types defined as hierarchical. I've got a CPT set to hierarchical, not strictly in order to have a nested hierarchy, but so that they can be ordered by the Simple Page Ordering plugin. Here's the code: register_post_type( 'case_study', array( 'label' => _x( 'case studies', 'post type plural name' ), 'labels' => array( 'name' => _x( 'Case studies', 'post type general name' ), 'singular_name' => _x( 'Case study', 'post type singular name' …
Created my first custom theme from scratch and I'm trying to do a listing of all posts with the same tag. In tag.php I display all posts with that specific tag via a WP_Query and I'm trying to implement the pagination for that listing (using paginate_links()). Page links seem to be outputted correctly. Also the first page looks good. What I don't understand is that when I go on to the next tag page (or to any of the page …
I have a page called portfolio and I have created several child pages for it like Video page, audio page etc … I also created custom page template for portfolio and named its file portfolio-template-ahsan.php. But when I use it on my child page as a custom template, it gives me the 404 error page. Now what I am confused about is how this naming convention works, and how should I name the child custom page templates, if I remove …
I would like to have a different template for categories and subcategories The categories template is set in categories.php is it somehow possible to load the subcategories template from subcategories.php or something like that?
I added category-news.php template file to the theme directory but it doesn't apply the template of the category but instead to the index.php file. category-slug.php is the highest level of the template heirarchy of WordPress so it should accept the file. I tried also category-id.php and it also doesn't work. The same for archives template files. However, when I use single-slug.php or page-slug.php it's working without any problems. I checked that there is not any conflicts with the permalinks, it's …
I have index.php and archive.php in my theme, but I'd like to using archive.php to display blog and category posts. Is it possible to override index.php by archive.php?
I was wondering how can I load parent theme template parts through child theme after customization. I have created three custom template for my theme and they are working fine. But now I want to load parent theme template parts layout. For example if I want edit profile page the location of the PHP file in parent theme is template_parts/layouts/profile/profile-modern.php In that folder there are other parts profile-header.php and other files. I tried to edit the profile-mordern.php directly in the …
I have number of legal documents of different formats / layout that I need to display on a Wordpress site, however I don't want to have them as individual page-pagename.php files in the root of the project folder. I know I can use get_template_part() and load in different template files, but this won't really help me because the files are all of differing styles. Is there any way of storing pages in a subfolder called, say, legal, and then pulling …
I have a custom taxonomy (projects) linked to several different custom post types (events, stories, tutorials, news, podcast), as well as pages. [I KNOW, but that is how I need it to be] And have bashed the permalinks so that we can have: example.com/project-1-name/events/ example.com/project-2-name/events/event-details-page/ example.com/project-1-name/news/ example.com/project-2-name/contact-us-page/ etc etc etc... All working great... apart from one thing. when we enter example.com/project-1-name/ - I don't want each project's taxonomy term root archive to show, I want the 'home' page for each …
TL:DR; Is it possible to restrict page templates to a certain site within a multisite network? (Using something like get_current_blog_id for e.g) More details I’m building out several websites that each use the same base partials, just in different variations in their page templates. For e.g Site A & Site B’s home page both use Components A - D, however Site A’s goes A B C D and Site B’s goes C B A D. All my actual markup goes …
I have a problem using pagination for terms in my custom taxonomy, let's call it Case-Studies. If i go to /insights/page/2, posts will be displayed correctly, and I can navigate between pages. The problem comes when accessing /insights/case-studies/page/2, which will actually show me the posts from /insights/page/2 ( the content gets redirected, and also, /insights/case-studies/page/2 will access archive-insights instead of taxonomy-insights. /insights/case-studies works fine, but when adding a pagination, all content shown will be actually the content from root (/insights/page/2) …
I am creating a custom theme with my own HTML. I am trying to override woocommerce template. I have created a template named with woocommerce.php but it still shows template with default structure. I checked the system status and it says that Your theme has a woocommerce.php file, you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues. But when I load the shop page it …
Just wonder what is the difference between the "Main Index Template" index.php and HomePage front-page.php. It seems that front-page.php is displayed when visiting https://www.example.com/, but index.php seems also to be served for such a purpose. If index.php is not used when visiting https://www.example.com, when it will be used?
Usually if you want to customise a post (generic: ie all) type in WordPress you would create a custom page template for it ie, following the template hierarchy, a page will be customised based on it's name and where it falls in that hierarchy. The further to the left in the following template graphic, the first it will get chosen. If I've ever needed to create a custom page format, that's what I've done. With pages (and not posts) you …
I know there is a high chance I understood this the wrong way and I have a linear thinking so please bear with me, I am just following the official documentation my understanding is if I create a file test.php for example in the root directory of my theme. and I visit the link to example.com/test.php or just example.com/test wordpress will follow the hierarchy rules and look for the file test.php and show me its content however that doesn't happen. …