Perhaps you could consider using WP REST API to get the posts with a XMLHttpRequest in javascript instead of trying to get php work on .html file(s).
From the REST handbook,
The WordPress REST API provides an interface for applications to
interact with your WordPress site by sending and receiving data as
JSON (JavaScript Object Notation) objects.
And
It provides data access to the content of your site, and implements
the same authentication restrictions — content that is public on your
site is generally publicly accessible via the REST API, while private
content, password-protected content, internal users, custom post
types, and metadata is only available with authentication or if you
specifically set it to be so.
Related Posts:
- Missing sidebar parameter “fix” – before_content
- Widget back end radio button issue
- Current WordPress Page Title as Search Parameter into A Tag
- How to include checkbox in widget backend form?
- How do I change/modify the_post_thumbnail(); html output?
- How do I make an HTML table from a database table?
- Limit the number of inactive widgets
- start_lvl Ignored in Custom walker_nav_menu
- How to get the custom header image’s alt text?
- Why do templates contain so many PHP tag pairs?
- Modify previous and next text from pagination links
- How do I use Shortcodes inside of HTML tags?
- add_filter the_content str_replace after shortcode
- Correct regex for wp_embed_register_handler
- How display widget by id
- Why would a GET variable one one page of a site cause a 404 error when a GET variable works on another page of a site?
- How can I make my custom shortcode work in a Custom HTML Widget?
- What exactly does “Posts page” do in WordPress?
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- Create Image Uploader for Widget
- WordPress Ajax always returns a 404 error
- Adding a search form inside a div
- WordPress custom taxonomy description for each post?
- How to get the registered sidebar’s name by its id?
- WordPress Shortcode and Dynamic CSS
- Displaying a variable stored in functions.php inside widget
- Check if widget has content
- Transform php code into a widget?
- Calling a method from functions.php on a click of a button
- Load custom field value into div with AJAX
- How do I create a drop down menu in a widget?
- Blank on static home page?
- WordPress widget in custom theme
- Correct way to make static pages editable in wordpress
- Conditional statement for parent, child and grandchild pages
- How do I edit the php/html for a particular post?
- Nice scroll to wordpress
- How to use SRCSET with get_the_post_thumbnail()?
- Multiple pages on one with different HTML
- How to use a frontend URL with a Plugin
- How to allow PHP In WordPress text widget
- How do I make wordpress comment fields required?
- Two posts in same div – WP loop
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- display most popular tags in two columns
- List authors with posts in a category
- Is it ok to replace php code with html?
- How to display blog images using wordpress in existing project
- How to add Shortcode (font awesome) in widget title?
- Add custom HTML to posts page
- How to add a post or page tag to the list of classes appearing in the body tag’s class attribute?
- WordPress Wysiwyg Content not being displayed
- Anything I can add to functions.php to make text widgets accept PHP?
- Show Specific Footer Widget for Specific Pages
- WordPress menu deletes when trying to add a hook
- dynamic sidebar not showing anything
- PHP contact form returns warning in text widget [closed]
- How can I add a specific, custom widget to my theme’s header.php?
- Get widget settings function?
- Widgets not showing in my custom theme
- Javascript code inside “” in core WordPress files .php
- HTML table from shortcode with multiple parameters
- Minify HTML, CSS, JS with PHPWee?
- Class ‘WP_Widget’ not found
- nowplaying.include.php Will Not Display Results
- How to display a value from a radio button in the options menu in wordpress
- Header has extra HTML block at top before my code
- javaScript in section of WP API
- To echo or not to echo?
- Blank space at beginning of tag?
- Style every second widget?
- How do I add HTML to a PHP function [closed]
- Custom image upload
- How to display recent posts on home page with custom HTML
- How to group 2 radio buttons in a widget?
- Add before_content and after_content to register_sidebar
- WordPress automatically adds tags when pasting code, how to stop it?
- Add HTML Attributes To Anchor Tags In `wp_list_categories()` Function
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- I can’t get my custom widget area to show on my WordPress site
- How to run PHP code in Text Widget with no plugin in WP 4.4
- Placing raw HTML inside a WordPress shortcode
- How to only show page id as body class?
- WordPress widget/sidebar dividers?
- Slide in Panel WordPress Post
- Shortcode content output but not in correct place
- Correct syntax to html php conversion
- An unwanted inline style is added to my body tag
- custom widget on the footer
- How to properly insert a link to a template in WordPress?
- Upload Image in a WordPress page using PHP
- Show post in slider
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Removing unneccessary p-tags (Not every p)
- How can I hide Home in my menu in a specific page?
- WordPress automatically adding html tag around PHP code
- How Display Posts on category
- How to get the POST TITLE using the POST ID?
- HTML tags in bloginfo description
- ACF page while loop breaks footer while loop