本文整理汇总了PHP中is_anspress函数的典型用法代码示例。如果您正苦于以下问题:PHP is_anspress函数的具体用法?PHP is_anspress怎么用?PHP is_anspress使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_anspress函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init_scripts_front
function init_scripts_front()
{
if (is_anspress()) {
wp_enqueue_script('jquery');
wp_enqueue_script('tagsinput', ap_get_theme_url('js/bootstrap-tagsinput.min.js'), 'jquery', AP_VERSION);
wp_enqueue_script('jquery-form', array('jquery'), false, true);
wp_enqueue_script('ap-site-js', ANSPRESS_URL . 'assets/ap-site.js', 'jquery', AP_VERSION);
wp_enqueue_script('tooltipster', ap_get_theme_url('js/jquery.tooltipster.min.js'), 'jquery', AP_VERSION);
wp_enqueue_script('jstorage', ap_get_theme_url('js/jstorage.js'), 'jquery', AP_VERSION);
//wp_enqueue_script( 'perfect-scrollbar', ap_get_theme_url('js/perfect-scrollbar.min.js'), 'jquery', AP_VERSION);
wp_enqueue_script('ap-js', ap_get_theme_url('js/ap.js'), 'jquery', AP_VERSION);
wp_enqueue_style('tagsinput', ap_get_theme_url('css/bootstrap-tagsinput.css'), array(), AP_VERSION);
wp_enqueue_style('tooltipster', ap_get_theme_url('css/tooltipster.css'), array(), AP_VERSION);
//wp_enqueue_style( 'perfect-scrollbar', ap_get_theme_url('css/perfect-scrollbar.min.css'), array(), AP_VERSION);
wp_enqueue_style('ap-style', ap_get_theme_url('css/ap.css'), array(), AP_VERSION);
wp_enqueue_style('ap-fonts', ap_get_theme_url('fonts/style.css'), array(), AP_VERSION);
do_action('ap_enqueue');
wp_enqueue_style('ap-overrides', ap_get_theme_url('css/overrides.css'), array(), AP_VERSION);
?>
<script type="text/javascript">
var ajaxurl = '<?php
echo admin_url('admin-ajax.php');
?>
',
ap_max_tags = '<?php
echo ap_opt('max_tags');
?>
';
</script>
<?php
wp_localize_script('ap-site-js', 'aplang', array('password_field_not_macthing' => __('Password not matching', 'ap'), 'password_length_less' => __('Password length must be 6 or higher', 'ap'), 'not_valid_email' => __('Not a valid email', 'ap'), 'username_less' => __('Username length must be 4 or higher', 'ap'), 'username_not_avilable' => __('Username not available', 'ap'), 'email_already_in_use' => __('Email already in use', 'ap'), 'loading' => __('Loading', 'ap'), 'sending' => __('Sending request', 'ap'), 'adding_to_fav' => __('Adding question to your favorites', 'ap'), 'voting_on_post' => __('Sending your vote', 'ap'), 'requesting_for_closing' => __('Requesting for closing this question', 'ap'), 'sending_request' => __('Submitting request', 'ap'), 'loading_comment_form' => __('Loading comment form', 'ap'), 'submitting_your_question' => __('Sending your question', 'ap'), 'submitting_your_answer' => __('Sending your answer', 'ap'), 'submitting_your_comment' => __('Sending your comment', 'ap'), 'deleting_comment' => __('Deleting comment', 'ap'), 'updating_comment' => __('Updating comment', 'ap'), 'loading_form' => __('Loading form', 'ap'), 'saving_labels' => __('Saving labels', 'ap'), 'loading_suggestions' => __('Loading suggestions', 'ap'), 'uploading_cover' => __('Uploading cover', 'ap'), 'saving_profile' => __('Saving profile', 'ap'), 'sending_message' => __('Sending message', 'ap'), 'loading_conversation' => __('Loading conversation', 'ap'), 'loading_new_message_form' => __('Loading new message form', 'ap'), 'loading_more_conversations' => __('Loading more conversations', 'ap'), 'searching_conversations' => __('Searching conversations', 'ap'), 'loading_message_edit_form' => __('Loading message form', 'ap'), 'updating_message' => __('Updating message', 'ap'), 'deleting_message' => __('Deleting message', 'ap'), 'uploading' => __('Uploading', 'ap')));
}
}
示例2: while
while (ap_questions()) {
ap_the_question();
ap_get_template_part('content-list');
}
?>
</div>
<?php
ap_questions_the_pagination();
?>
<?php
} else {
ap_get_template_part('content-none');
}
?>
</div>
<?php
if (is_active_sidebar('ap-sidebar') && is_anspress()) {
?>
<div class="ap-question-right col-md-3">
<?php
dynamic_sidebar('ap-sidebar');
?>
</div>
<?php
}
?>
</div>
示例3: ap_get_current_page_template
function ap_get_current_page_template()
{
if (is_anspress()) {
$template = ap_current_page_is();
return apply_filters('ap_current_page_template', $template . '.php');
}
return 'content-none.php';
}
示例4: editor_buttons
/**
* Configure which button will appear in wp_editor
* @param array $buttons Button names.
* @param string $editor_id Editor ID.
* @return array
*/
public function editor_buttons($buttons, $editor_id)
{
if (is_anspress()) {
return array('bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'link', 'unlink', 'blockquote', 'pre');
}
return $buttons;
}
示例5: ap_get_current_user_page_template
function ap_get_current_user_page_template()
{
if (is_anspress()) {
$user_page = get_query_var('user_page');
$user_page = $user_page ? $user_page : 'profile';
$template = 'user-' . $user_page . '.php';
return apply_filters('ap_get_current_user_page_template', $template);
}
return 'content-none.php';
}
示例6: is_ap_user
/**
* Check if current page is user page
* @return boolean
*/
function is_ap_user()
{
if (is_anspress() && ap_current_page() == ap_get_user_page_slug()) {
return true;
}
return false;
}
示例7: wp_head
/**
* Add feed and links in HEAD of the document
*/
public function wp_head()
{
if (is_anspress()) {
$q_feed = get_post_type_archive_feed_link('question');
$a_feed = get_post_type_archive_feed_link('answer');
echo '<link rel="alternate" type="application/rss+xml" title="' . esc_attr__('Question feed', 'ap') . '" href="' . esc_url($q_feed) . '" />';
echo '<link rel="alternate" type="application/rss+xml" title="' . esc_attr__('Answers feed', 'ap') . '" href="' . esc_url($a_feed) . '" />';
}
if (is_question() && get_query_var('ap_page') != 'base') {
echo '<link rel="canonical" href="' . esc_url(get_permalink(get_question_id())) . '">';
echo '<link rel="shortlink" href="' . esc_url(wp_get_shortlink(get_question_id())) . '" />';
}
}
示例8: editor_plugins
public function editor_plugins($plugin, $editor_id)
{
if (is_anspress()) {
$plugin[] = 'wpautoresize';
}
return $plugin;
}
示例9: ap_truncate_chars
<?php
echo ap_truncate_chars($category->description, 70);
?>
</div>
<?php
}
?>
</div>
</li>
<?php
}
?>
</ul>
</div>
<?php
ap_pagination();
?>
</div>
<?php
if (is_active_sidebar('ap-category') && is_anspress()) {
?>
<div class="ap-question-right col-md-3">
<?php
dynamic_sidebar('ap-category');
?>
</div>
<?php
}
?>
</div>
示例10: body_class
public function body_class($classes)
{
// add anspress class to body
if (is_anspress()) {
$classes[] = 'anspress';
}
// return the $classes array
return $classes;
}
示例11: ap_title
public function ap_title($title)
{
if (is_anspress()) {
$new_title = ap_page_title();
$new_title = str_replace('[anspress]', $new_title, $title);
$new_title = apply_filters('ap_title', $new_title);
return $new_title;
}
return $title;
}
示例12: is_ap_user
function is_ap_user()
{
if (is_anspress() && get_query_var('ap_page') == 'user') {
return true;
}
return false;
}
示例13: _e
_e('No description.', 'tags_for_anspress');
}
?>
</div>
</div>
</li>
<?php
}
?>
</ul><!-- close .ap-term-tag-box.clearfix -->
<?php
ap_pagination();
?>
</div><!-- close #ap-tags -->
<?php
if (is_active_sidebar('ap-tags') && is_anspress()) {
?>
<div class="ap-tags-sidebar col-md-3">
<?php
dynamic_sidebar('ap-tags');
?>
</div>
<?php
}
?>
</div><!-- close .row -->
示例14: while
/* Start the Loop */
while (ap_activities()) {
ap_the_activity();
ap_get_template_part('activity/item');
}
?>
</div>
<?php
ap_activity_pagination();
?>
<?php
} else {
ap_get_template_part('content-none');
}
?>
</div>
<?php
if (is_active_sidebar('ap-activity') && is_anspress()) {
?>
<div class="ap-question-right col-md-3">
<?php
dynamic_sidebar('ap-activity');
?>
</div>
<?php
}
?>
</div>
示例15: feed_link
public function feed_link()
{
if (is_anspress()) {
echo '<link href="' . esc_url(home_url('/feed/question-feed')) . '" title="' . __('Question >> Feed', 'ap') . '" type="application/rss+xml" rel="alternate">';
}
}