jQuery 自定义应用程序与 Wordpress 集成
jQuery Custom app integration with Wordpress
我创建了 html/jquery 应用程序,我目前 运行 通过将其作为原始 html.
嵌入到其中一个页面中
网站有 Wishlist 会员插件 运行。
我需要以这种方式将应用程序与 WordPress 集成,这样我就可以在当前用户下 save/retrieve 数据库中的一些 JSON 数据,因此只有该用户可以拥有访问它。
我对编程还是很陌生,任何help/direction将不胜感激。
其实我自己也找到了答案,毕竟不是那么难...
创建自定义模板页面,需要是 PHP 文件:
<?php
/**
* Template Name: Your Custom Name
*
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<!-- page title, displayed in your browser bar -->
<title><?php bloginfo('name'); ?> | <?php is_home() ? bloginfo('description') : wp_title(''); ?></title>
<!-- add feeds, pingback and stuff-->
<link rel="profile" href="http://gmpg.org/xfn/11" />
<?php wp_head(); ?>
</head>
<body id="top">
<div class='container_wrap' id='main'>
<div class='container'>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php wp_footer(); ?>
<!-- Your HTML content here-->
</body>
</html>
"Your Custom Name" 将显示在 wordpress 页面的右侧,因此您可以选择作为您的自定义模板。
您可以在 "Your HTML content here" 中插入您的代码。
现在,插入此文件的最佳位置是在子主题文件夹中,这是最安全的方式。如果您需要有关儿童主题的说明,有一篇很好的文章http://www.wpbeginner.com/beginners-guide/how-to-install-a-wordpress-child-theme/
这对我有用。祝你好运!
我创建了 html/jquery 应用程序,我目前 运行 通过将其作为原始 html.
嵌入到其中一个页面中网站有 Wishlist 会员插件 运行。
我需要以这种方式将应用程序与 WordPress 集成,这样我就可以在当前用户下 save/retrieve 数据库中的一些 JSON 数据,因此只有该用户可以拥有访问它。
我对编程还是很陌生,任何help/direction将不胜感激。
其实我自己也找到了答案,毕竟不是那么难... 创建自定义模板页面,需要是 PHP 文件:
<?php
/**
* Template Name: Your Custom Name
*
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<!-- page title, displayed in your browser bar -->
<title><?php bloginfo('name'); ?> | <?php is_home() ? bloginfo('description') : wp_title(''); ?></title>
<!-- add feeds, pingback and stuff-->
<link rel="profile" href="http://gmpg.org/xfn/11" />
<?php wp_head(); ?>
</head>
<body id="top">
<div class='container_wrap' id='main'>
<div class='container'>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<?php wp_footer(); ?>
<!-- Your HTML content here-->
</body>
</html>
"Your Custom Name" 将显示在 wordpress 页面的右侧,因此您可以选择作为您的自定义模板。
您可以在 "Your HTML content here" 中插入您的代码。
现在,插入此文件的最佳位置是在子主题文件夹中,这是最安全的方式。如果您需要有关儿童主题的说明,有一篇很好的文章http://www.wpbeginner.com/beginners-guide/how-to-install-a-wordpress-child-theme/
这对我有用。祝你好运!