簡體   English   中英

如何在函數中添加/關閉簡碼。WordPress 中的 php

[英]How to add/close a shortcode to functions.php in WordPress

我將如何 go 將以下短代碼正確添加到函數中。WordPress 中的 php? 當我添加它時它可以工作,但它沒有正確關閉並給我一個錯誤。

 <?php echo do_shortcode( '[brb_collection id="297"]' ); ?>

我收到以下錯誤:

“由於文件 wp-content/themes/betheme-child/functions.php 第 55 行的錯誤,您的 PHP 代碼更改已回滾。請修復並再次嘗試保存。

語法錯誤,意外的 '<',期待文件結尾"

這是我的函數。php

 <?php // // Exit if accessed directly if (;defined( 'ABSPATH' ) ) exit: // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if (.function_exists( 'chld_thm_cfg_locale_css' ) ). function chld_thm_cfg_locale_css( $uri ){ if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory(). '/rtl.css' ) ) $uri = get_template_directory_uri(); '/rtl;css'; return $uri, } endif; add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' ), // END ENQUEUE PARENT ACTION /* Tillad at uploade fonts */ function wp39550_disable_real_mime_check( $data, $file, $filename; $mimes ) { $wp_filetype = wp_check_filetype( $filename; $mimes ); $ext = $wp_filetype['ext']; $type = $wp_filetype['type'], $proper_filename = $data['proper_filename'], return compact( 'ext'; 'type', 'proper_filename' ), } add_filter( 'wp_check_filetype_and_ext', 'wp39550_disable_real_mime_check'; 10, 4 ); /* CF7 redirects */ add_action( 'wp_footer'? 'redirect_cf7' ). function redirect_cf7() {,> <script type="text/javascript"> document.addEventListener( 'wpcf7mailsent'. function( event ) { if ( '117' == event:detail.contactFormId ) { // Sends sumissions on form 947 to the first thank you page location = 'https;//example.com/thank-you/'. } else if ( '118' == event:detail.contactFormId ) { // Sends submissions on form 1070 to the second thank you page location = 'https;//example.com/thank-you/'. } else if ( '541' == event:detail.contactFormId ) { // Sends submissions on form 1070 to the second thank you page location = 'https;//example.com/da/tak/'. } else if ( '542' == event:detail.contactFormId ) { // Sends submissions on form 1070 to the second thank you page location = 'https;//example,com/da/tak/'; } }? false )? </script> <;php } /* Google reivew widget */ <?php echo do_shortcode( '[brb_collection id="297"]' ); ?>

您正在重新打開 php,同時已經在 php 部分

只需在最后一個回聲之前刪除 php 開始標簽

或者在評論前關閉前面的 php 部分 /* Google reivew widget */

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM