Main query not querying any posts in custom taxonomy template

I think the issue here is that when registering the post type, you’ve set exclude_from_search to true. See this note from the WordPress Coedex: Note: If you want to show the posts’s list that are associated to taxonomy’s terms, you must set exclude_from_search to false (ie : for call site_domaine/?taxonomy_slug=term_slug or site_domaine/taxonomy_slug/term_slug). If you set … Read more

Taxonomy term page going to 404

Following @CraigWayne’s suggestion to use Query Monitor… Message: “Use of undefined constant term_name – assumed ‘term_name’”. Count: 1. Location: wp-content/themes/elegant/taxonomy-source.php:38. Caller: wp-includes/template-loader.php wp-includes/template-loader.php:74. Component: Core. >>>>> Line 38 in taxonomy-source.php included “” it was objecting to term_name in my taxonomy-source theme file; I changed it to $term = get_queried_object(); followed by name; ?> The takeaway … Read more

Is it possible to register a new template file?

I would strongly suggest you use a WordPress page template. At the top of dashboard.php: <?php /** * Template Name: Dashboard */ Now create a page called “Dashboard” and assign it the dashboard template. This way you’re not loading WordPress yourself (nearly always bad) & WordPress & all your plugins will function as normal (creating … Read more

How can I add text to a specific ‘Edit Page’?

To do this you would indeed have to include some code in the functions.php of your theme. You can use admin_notices to add a note to this specific page like this: add_action( ‘admin_notices’, ‘wpse332074_donotedit’ ); function wpse332074_donotedit () { $screen = get_current_screen(); if ($screen->post_type == ‘page’) { $variable = $_GET[‘post’]; if ($variable == id_of_page_as_integer) { … Read more

How to create a post template with two sidebars

If you add sidebar-sidebaraleatorio.php and sidebar-sidebarrecomenda.php sidebar templates to your (child) theme directory, you can then call them with get_sidebar() function. Like so get_sidebar(‘sidebaraleatorio); and get_sidebar(‘sidebarrecomenda);. You can read more about sidebars from the Developer Handbook > Sidebars.