display shortcode in post temlate
-
Hi gret plugin.
Im lookin for solution how to display pods shortcode on templte.php fille.
<?php echo do_shortcode(‘[pods name=”samochod” where=”category.name=’osobowe'” template=”Samochody”]’); /> does’t work.I’ts giving me an error “Parse error: syntax error, unexpected ‘osobowe’ (T_STRING), expecting ‘)’ in /home/lukas/domains/kreotech.pl/public_html/goleasing/wp-content/themes/go-leasing/samochody.php on line 54″
my themplate:
<?php
/**
* Template Name: Cars
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other ‘pages’ on your WordPress site will use a
* different template.
*
* @package understrap
*//**
* Allow Pods Templates to use shortcodes
*
* NOTE: Will only work if the constant PODS_SHORTCODE_ALLOW_SUB_SHORTCODES is defined and set to
true, which by default it IS NOT.
*/
add_filter( ‘pods_shortcode’, function( $tags ) {
$tags[ ‘shortcodes’ ] = true;return $tags;
});
?>
<?php
// Exit if accessed directly.
defined( ‘ABSPATH’ ) || exit;get_header();
?><!– Card –>
<section>
<div class=””>
<div class=”bg-top”></div>
</div></section>
<section class=”py-5 position-relative”>
<div class=”container-fluid”>
<div class=”row justify-content-center”>
<div class=”col-12 text-center “>
<div class=”tekst-height d-inline-block text-left mt-3″>
<p class=”tekst-2 text-creative”>samochody</p>
<p class=”tekst-1 text-creative”>Go Leasing</p>
</div>
</div>
</div>
</div>
<div class=”trojkat-t” data-aos=”zoom-in-left” data-aos-duration=”2000″>
</div></section>
<span style=”color: #0000ff;”>Osobowe</span>
<div class=”row”><?php echo do_shortcode(‘[pods name=”samochod” where=”category.name=’osobowe'” template=”Samochody”]’); />
?>
</div><span style=”color: #ff0000;”>Dostawcze</span>
<div class=”row”>
<?php echo do_shortcode(‘[pods name=”samochod” where=”category.name=’dostawcze'” template=”Samochody”]’); />
?>
</div><?php get_footer(); ?>
Can you help me solve this problem?
The page I need help with: [log in to see the link]
- The topic ‘display shortcode in post temlate’ is closed to new replies.