This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This filter will override AnsPress rewrite rule | |
* @param array $rules | |
**/ | |
function my_custom_ap_rewrite($rules){ | |
global $wp_rewrite; | |
$base_page_id = ap_opt('base_page'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function after_new_question($post_id, $post) { | |
update_post_meta($post_id, ANSPRESS_VOTE_META, '0'); | |
update_post_meta($post_id, ANSPRESS_SUBSCRIBER_META, '0'); | |
update_post_meta($post_id, ANSPRESS_CLOSE_META, '0'); | |
update_post_meta($post_id, ANSPRESS_FLAG_META, '0'); | |
update_post_meta($post_id, ANSPRESS_VIEW_META, '0'); | |
update_post_meta($post_id, ANSPRESS_UPDATED_META, current_time('mysql')); | |
update_post_meta($post_id, ANSPRESS_SELECTED_META, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db = @mysql_connect('localhost', 'username', 'password') or die(mysql_error()); | |
mysql_select_db('database_name', $db) or die(mysql_error()); | |
$qry_qbank = mysql_query("SELECT * FROM Table_Name limit 0, 100") or die(mysql_error()); | |
require('wp-blog-header.php'); | |
while ($row = mysql_fetch_array($qry_qbank)) { | |
$qno = $row['id']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: AskBug Child | |
Theme URI: http://anspress.io/download/askbug/ | |
Author: Rahul Aryan | |
Template: askbug | |
Author URI: http://anspress.io/ | |
Description: AskBug is a theme for question and answer community site based on AnsPress plugin. This theme can be used to create a big community site or a simple support site. | |
Version: 1.2 | |
License: GNU General Public License v3.0 / | |
License URI: http://www.gnu.org/licenses/gpl-3.0.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Import parent theme style | |
*/ | |
add_action( 'wp_enqueue_scripts', 'askbugchild_enqueue_styles' ); | |
function askbugchild_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db = @mysql_connect('localhost', 'username', 'password') or die(mysql_error()); | |
mysql_select_db('database_name', $db) or die(mysql_error()); | |
$qry_qbank = mysql_query("SELECT * FROM Table_Name limit 0, 100") or die(mysql_error()); | |
while ($row = mysql_fetch_array($qry_qbank)) { | |
$qno = $row['id']; | |
$question_title = $row['Question_Title']; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Blog Page | |
* Template used to display blog page | |
* | |
* @package ab | |
*/ | |
get_header(); ?> | |
<div class="container"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE IF NOT EXISTS `at_qa_dump` ( | |
`ID` int(11) NOT NULL AUTO_INCREMENT, | |
`Question_Title` text, | |
`Question_Content` text, | |
`Answer_Content` text, | |
`Category_Id` int(11) DEFAULT NULL, | |
`Tag_Id` int(11) DEFAULT NULL, | |
`Question_User_Id` int(11) DEFAULT 1, | |
`Answer_User_Id` int(11) DEFAULT 2, | |
`AnsPress_Question_Id` varchar(255) DEFAULT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_override_ap_icon($icon) { | |
if($icon == 'chevron-down') | |
return 'apicon-reputation'; | |
return $icon; | |
} | |
apply_filter('ap_icon', 'my_override_ap_icon'); |