What is the method to switch to specific page on entering theme customizer screen?

On entering the theme customizer, it defaults to the set home page, however I need to change the default to a page with ID 45.

The set home page uses a special template and is formatted by the elementor plugin so it is not expected to respond to the theme customizations. The page ID 45 uses the primary theme and is not set for public display, but solely for the purpose of previewing the changes.

I tried the following without success

add_action('customize_register', function($  mgr)  {   add_action('customize_controls_print_scripts', function()    {     echo '     <script>     wp.customize.previewer.previewUrl.set(wp.customize.settings.url + "?page_id=45");     </script>     ';   } } 

The console error states cannot read property of previewUrl but I am stumped on resolving the errors. I reviewed the customizer js api at https://developer.wordpress.org/themes/customize-api/the-customizer-javascript-api/ but just cannot determine the correct process.

How to create templates for a custom module to show on the front end within my theme?

I’d like to create a simple plugin with a form on the front end which submits the value of 3 fields into a DB table.

For the plugin, I’ve been using this answer: https://wordpress.stackexchange.com/a/162476/77891

What I can’t get working now, is a template.

Within the main plugin file, I’ve added:

add_action( 'gm_virtual_pages', function( $  controller ) {      // first page     $  controller->addPage( new \WEBP\Management\Page( '/custom/page' ) )         ->setTitle( 'My First Custom Page' )         ->setTemplate( 'custom-page-form.php' ); } ); 

And my custom-page-form.php:

<?php  echo "Test Echo";  ?> <p>Test</p> <p>Echo</p>  

The title is being displayed (My First Custom Page). But not my Test Echo. How does a correct / working template file have to look like?

Where to use Post class in a real theme, title, content or parent div or article tag?

I am extending discussion from one another article posted on the same website → Where should I use post_class()?.

This is the portion from content-single.php

enter image description here

Where should I put the post-class? in the h2 tag that will print the title or on the parent article tag, which has one other div,which is a sibling to h2, title class?

  <h4><?php the_title(); ?></h4>   <p><?php the_content(); ?></p> 

I browsed this link, but still, I could not get the clarity → https://developer.wordpress.org/reference/functions/post_class/

REQUIRED: Could not find post_class. See: post_class <div id="post-" >

How do I use a database in a custom theme?

I’m new to WordPress but am creating a custom theme. I don’t know much php, but need to store information such as emails, as well as some custom info such as volunteer hours (for specific duties). The email will be stored for a newsletter. What is the easiest way to store this data? Can I use a plugin (despite creating a custom theme?)

Missing .twig files in wordpress theme editor

I just started learning timber. Timber uses twig as its templating engine.

This is great but I have a problem with displaying all .twig files in the theme editor. I’m using VS code for my code development so I have no problem viewing and accessing .twig files there.

My problem is with the built in wordpress theme editor.

Do you know of a way to show all the file/folder structure when using the theme editor? starting with displaying .twig files but would also be nice to see all file/folder structure including, vendor, composer.json etc…