问题描述:

I'm using [insert_php] plugin in Wordpress and I have inserted php function in it.If I set the block with the function before the the masonry grid it doesn't load.

If I move the block with the function after the grid it works well.

In console log is appearing an alert:

Syntax error, unrecognized expression: {'status':'Nothing found'}

How can I sole that?

Grid before php block

Block php before the grid

网友答案:

What you need to do is create a page template. This page template can be used to create PHP for your page to load, and you can even use <?php echo do_shortcode('[shortcode]'); ?>

To create a template just copy your page.php into a new file called tpl_test.php. Then make sure to have this in the very first line:

`<?php
/* 
    Template Name: Test Template
*/
?>`

Then, a small window will show up on the back-end of WordPress when you edit the page. In the right hand column you need to select the page template for the page you just created, and update the page. then, any code you put in the custom Page Template will display correctly on your WordPress site. Also, make sure <?php the_content() ?> is below your grid you are trying to output.

相关阅读:
Top