New answers tagged

2

You can use PHPs output buffering, using ob_start to turn on the buffering and ob_get_clean to get and delete the current output buffering. So going by your code it would look like this function blogPost(){ ob_start(); ?> <section class="blog container spacer"> <article class="blog__list"> <...


0

Another alternative is to get it from the query args directly. You can access all of the $args this way. $query = new WP_Query( $args ); // paged $paged_arg = $query->query['paged'];


1

After examining the code using developer tools, I was able to figure out the problem. Code was being wrapped in the pre tags which were causing the code to break its proper structure. Found the solution for the pre tags issue here which solved the problem.


2

Ultimately, I solved the problem by exporting the wp_posts table from the database and doing a regex search along the lines of '([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]', '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9])', '(.*?)\[soundcloud url=\\"http://api\.soundcloud\.com/tracks/(.*?)\\&...


0

This is unnecessary, WordPress already provides the fully rendered HTML content in REST responses with the shortcodes already processed and turned into HTML. Inside the object the API responds with is a content field that has a rendered sub-field containing what you want. Use that instead of the raw unprocessed version.


Top 50 recent answers are included