我使用plugin 包含此代码的,我想更改css和js以及模板。php位置位于我的模板目录中,而不是插件中,无需编辑插件文件
public function shortcode($atts, $content = NULL) {
global $post, $wpdb;
STATIC $i = 1;
$timelinr_options = get_option(\'timelinr_general_options\');
$desing_options = get_option(\'timelinr_desing_options\');
$pairs = array(
\'orientation\' => $timelinr_options[\'orientation\'],
\'startat\' => intval($timelinr_options[\'startat\']),
\'arrowkeys\' => $timelinr_options[\'arrowkeys\'],
\'autoplay\' => $timelinr_options[\'autoplay\'],
\'autoplaydirection\' => $timelinr_options[\'autoplaydirection\'],
\'autoplaypause\' => $timelinr_options[\'autoplaypause\'],
\'order\' => $timelinr_options[\'order\'],
\'containerdiv\' => \'timelinr-\'.$i,
\'category\' => \'\',
\'dateformat\' => $desing_options[\'dateformat\'],
);
$atts = shortcode_atts($pairs, $atts );
if ( strcmp ( $atts[\'orientation\'] , \'horizontal\' ) == 0){
wp_enqueue_style(\'timelinr-style\', JQTL_BASE_URL . \'/assets/css/style.css\', \'\', JQTL_CURRENT_VERSION );
} elseif ( strcmp ( $atts[\'orientation\'] , \'vertical\' ) == 0) {
wp_enqueue_style(\'timelinr-style_v\', JQTL_BASE_URL . \'/assets/css/style_v.css\', \'\', JQTL_CURRENT_VERSION );
}
ob_start();
include (JQTL_BASE_PATH . \'/includes/template.php\');
$out = ob_get_contents();
ob_end_clean();
$i++;
return $out;
}