wordpress-shortcode

How to use wordpress shortcodes in custom php file?

江枫思渺然 提交于 2021-01-29 13:52:57
问题 I want to display wpdatatables(plugin) in my custom PHP file so I wanted to use "do_shortcode()" function but nothing works it just shows white screen. my php file code: <?php $path = $_SERVER['DOCUMENT_ROOT']; include_once $path . '/wp-config.php'; include_once $path . '/wp-load.php'; include_once $path . '/wp-includes/wp-db.php'; include_once $path . '/wp-includes/pluggable.php'; define('WP_USE_THEMES', false); echo do_shortcode("[wpdatatable id=1]"); ?> 回答1: I think somehow you are not

Is there an easy way to convert a number to a word with wordpress via shortcode?

送分小仙女□ 提交于 2019-12-11 18:35:39
问题 Is there a function that will express any given number in words with shortcode ? i have tested this function but i think i have a problem with the shortecode. My function : function number_to_word( $num = '' ){ $num = ( string ) ( ( int ) $num ); if( ( int ) ( $num ) && ctype_digit( $num ) ) { $words = array( ); $num = str_replace( array( ',' , ' ' ) , '' , trim( $num ) ); $list1 = array('','one','two','three','four','five','six','seven', 'eight','nine','ten','eleven','twelve','thirteen',

Output content of WordPress Shortcode in text and footer

空扰寡人 提交于 2019-12-11 16:58:01
问题 I'm using a custom WordPress shortcode to add a modal to my content. The content of the modal is based on a Custom Post Type. The shortcode looks like this: [term value="Custom Link Title" id="123"] The value="" argument is for the modal link in the content. The id="" is the ID of the Custom Post Type. Inside the modal dialog window I display the content from the Custom Post Type based on it's ID. The problem is, that the link and the modal dialog are outputted togehter. And because of the