theme development – Is there any way to store single.php wordpress file into a php variable

Question

I am finding an way to store single.php file in a variable in wordpress file, I want to use preg_match_all to this file.

$regex = "~(<h([2-6]))(.*?>(.*)<\/h[2-6]>)~";
$singlefile= single.php

preg_match_all($regex, $singlefile, $heading_results);

Can anyone tell me proper way to do this?

0
Towfeeq Ahmad 4 months 2022-04-23T20:52:46-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse