*/ /** * Enqueue scripts. */ add_action( 'wp_enqueue_scripts', 'ap_scripts_front', 1 ); function ap_scripts_front() { if ( ! is_anspress() && ap_opt('load_assets_in_anspress_only' ) ) { return; } ap_enqueue_scripts(); $custom_css = ' #anspress .ap-q-cells{ margin-'.(is_rtl()? 'right' : 'left').': '.(ap_opt( 'avatar_size_qquestion' ) + 10).'px; } #anspress .ap-a-cells{ margin-'.(is_rtl()? 'right' : 'left').': '.(ap_opt( 'avatar_size_qanswer' ) + 10).'px; }#anspress .ap-comment-content{ margin-'.(is_rtl()? 'right' : 'left').': '.(ap_opt( 'avatar_size_qcomment' ) + 15).'px; }'; wp_add_inline_style( 'ap-theme-css', $custom_css ); do_action( 'ap_enqueue' ); wp_enqueue_style( 'ap-overrides', ap_get_theme_url( 'css/overrides.css' ), array( 'ap-theme-css' ), AP_VERSION ); echo ''; wp_localize_script('anspress-js', 'aplang', array( 'password_field_not_macthing' => __( 'Password not matching', 'anspress-question-answer' ), 'password_length_less' => __( 'Password length must be 6 or higher', 'anspress-question-answer' ), 'not_valid_email' => __( 'Not a valid email', 'anspress-question-answer' ), 'username_less' => __( 'Username length must be 4 or higher', 'anspress-question-answer' ), 'username_not_avilable' => __( 'Username not available', 'anspress-question-answer' ), 'email_already_in_use' => sprintf( __( 'Email already in use. %sDo you want to reset your password?%s', 'anspress-question-answer' ), '', '' ), 'loading' => __( 'Loading', 'anspress-question-answer' ), 'sending' => __( 'Sending request', 'anspress-question-answer' ), 'adding_to_fav' => __( 'Adding question to your favorites', 'anspress-question-answer' ), 'voting_on_post' => __( 'Sending your vote', 'anspress-question-answer' ), 'requesting_for_closing' => __( 'Requesting for closing this question', 'anspress-question-answer' ), 'sending_request' => __( 'Submitting request', 'anspress-question-answer' ), 'loading_comment_form' => __( 'Loading comment form', 'anspress-question-answer' ), 'submitting_your_question' => __( 'Sending your question', 'anspress-question-answer' ), 'submitting_your_answer' => __( 'Sending your answer', 'anspress-question-answer' ), 'submitting_your_comment' => __( 'Sending your comment', 'anspress-question-answer' ), 'deleting_comment' => __( 'Deleting comment', 'anspress-question-answer' ), 'updating_comment' => __( 'Updating comment', 'anspress-question-answer' ), 'loading_form' => __( 'Loading form', 'anspress-question-answer' ), 'saving_labels' => __( 'Saving labels', 'anspress-question-answer' ), 'loading_suggestions' => __( 'Loading suggestions', 'anspress-question-answer' ), 'uploading_cover' => __( 'Uploading cover', 'anspress-question-answer' ), 'saving_profile' => __( 'Saving profile', 'anspress-question-answer' ), 'sending_message' => __( 'Sending message', 'anspress-question-answer' ), 'loading_conversation' => __( 'Loading conversation', 'anspress-question-answer' ), 'loading_new_message_form' => __( 'Loading new message form', 'anspress-question-answer' ), 'loading_more_conversations' => __( 'Loading more conversations', 'anspress-question-answer' ), 'searching_conversations' => __( 'Searching conversations', 'anspress-question-answer' ), 'loading_message_edit_form' => __( 'Loading message form', 'anspress-question-answer' ), 'updating_message' => __( 'Updating message', 'anspress-question-answer' ), 'deleting_message' => __( 'Deleting message', 'anspress-question-answer' ), 'uploading' => __( 'Uploading', 'anspress-question-answer' ), 'error' => ap_icon( 'error' ), 'warning' => ap_icon( 'warning' ), 'success' => ap_icon( 'success' ), 'not_valid_response' => __( 'Something went wrong in server side, not a valid response.', 'anspress-question-answer' ), )); wp_localize_script('ap-site-js', 'apoptions', array( 'ajaxlogin' => ap_opt( 'ajax_login' ), )); } if ( ! function_exists( 'ap_comment' ) ) : function ap_comment($comment) { $GLOBALS['comment'] = $comment; include ap_get_theme_location( 'comment.php' ); } endif; add_action( 'widgets_init', 'ap_widgets_positions' ); function ap_widgets_positions() { register_sidebar(array( 'name' => __( 'AP Before', 'anspress-question-answer' ), 'id' => 'ap-before', 'before_widget' => '
', 'description' => __( 'Widgets in this area will be shown before anspress body.', 'anspress-question-answer' ), 'before_title' => '