Getting page output HTML without request (for CriticalCSS, PurgeCSS)
Getting page output HTML without request (for CriticalCSS, PurgeCSS)
Getting page output HTML without request (for CriticalCSS, PurgeCSS)
Create Page Template by hook programatically in Functions.php in WP 5.8.1
WordPress Pagination changes my template
Get name of current page template in Gutenberg era
Pagination stopped working after assigning custom page template to new page (different slug)
<script type=”text/javascript”> function removeLink() { theAs = document.getElementById(‘lg_image’).childNodes; // get all children of div#lg_image for( i = 0; i < theAs.length; i++ ) { // loop through the children if( theAs[i].nodeType != 3 ) { // if the child is not a whitespace, theImg = theAs[i].innerHTML; // it is the a which contains the img, … Read more
Include wp-load.php on your page and you’ll have access to the WordPress API.
You should use wpdb to query the database and then insert them into the loop (loop.php).
The template loader determines which template to load for a given view, there’s a filter available to change this though, template_include as seen on the source page linked. Moved from comment to answer.
Here’s a function to print the URI of the first page using an “Archive” page template. It assumes the template is named template-archive.php (don’t name it archive.php and hijack the Template Hierarchy!). You can either drop this in functions.php and call it in a template or you can just use the code within the function … Read more