Changeset 1546421
- Timestamp:
- 12/06/2016 11:42:45 AM (9 years ago)
- Location:
- faq-in-minute/trunk
- Files:
-
- 6 edited
-
faq.php (modified) (1 diff)
-
faq_all.php (modified) (16 diffs)
-
readme.txt (modified) (2 diffs)
-
screenshot-2.png (modified) (previous)
-
screenshot-5.png (modified) (previous)
-
screenshot-6.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
faq-in-minute/trunk/faq.php
r1354020 r1546421 2 2 3 3 <style type="text/css"> 4 .panel-heading span 5 { 6 margin-top: -21px; 7 font-size: 15px; 8 margin-right: -9px; 4 5 .faq_heading { 6 background-color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0'];?>!important ; 7 color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_2']; ?>!important ; 8 text-decoration: none ; 9 cursor: pointer; 10 } 11 .panel-heading.faq_heading { 12 background: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0'];?>!important ; 13 color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_2']; ?>!important ; 14 text-decoration: none ; 15 cursor: pointer; 16 } 17 .collapsed.faq_link { 18 box-shadow: 0 0; 9 19 } 10 a.clickable { color: inherit; }11 a.clickable:hover { text-decoration:none; }12 .panel-heading{13 padding:12px 25px;14 -webkit-border-radius: 7px;15 -moz-border-radius: 7px;16 border-radius: 7px;17 background-color: #e1e1e1;18 border: solid 1px #cacaca;19 color:#1d1d1d;20 font-size:18px;21 font-family: 'OpenSansRegular';22 }23 24 .panel-body{25 padding:25px;26 }27 .panel-heading i{28 font-size:25px;29 color:#fff;30 text-shadow: 0 0 1px rgba(0,0,0,.45);31 }32 .panel{33 box-shadow:none;34 margin:1px 0;35 border-bottom:none;36 }37 38 .firstleftlable{39 background:url(<?php echo plugins_url('images/firstaccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;40 background-size: auto 100%;41 }42 .secoendtleftlable{43 background:url(<?php echo plugins_url('images/secoendaccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;44 background-size: auto 100%;45 }46 .thirdtleftlable{47 background:url(<?php echo plugins_url('images/thirdaccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;48 background-size: auto 100%;49 }50 .fourtleftlable{51 background:url(<?php echo plugins_url('images/fouraccordingtab.png', __FILE__); ?>) no-repeat <?php echo $faqsettingdata['faq_in_minute_cat_text_field_0']; ?>;52 background-size: auto 100%;53 }54 55 20 .cursor-desing{ 56 21 cursor: pointer; 57 22 } 58 59 .new_fq { 60 color: <?php echo $faqsettingdata['faq_in_minute_cat_text_field_2']; ?>; 61 cursor: pointer; 62 font-family: "<?php echo $faqsettingdata['faq_in_minute_cat_select_field_6']; ?>"; 63 font-size: 14.375px; 64 font-weight:<?php echo $faqsettingdata['faq_in_minute_cat_radio_field_3']; ?>; 65 outline-style: none; 66 } 67 23 68 24 </style> 69 <div id="container">70 <div id="content">71 72 <?php $color_fim = array('firstleftlable', 'secoendtleftlable', 'thirdtleftlable', 'fourtleftlable'); ?>73 74 <?php75 $args = array(76 'posts_per_page' => $posts_per_page,77 'offset' => 0,78 'category' => '',79 'category_name' => $cat,80 'faqcategory'=>$faqcat,81 'orderby' => 'post_date',82 'order' => $ord,83 'include' => '',84 'exclude' => '',85 'meta_key' => '',86 'meta_value' => '',87 'post_type' => 'faq_in_minute_cat',88 'post_mime_type' => '',89 'post_parent' => 0,90 'post_status' => 'publish',91 );92 $all_data = get_posts($args);93 94 // echo '<pre>' ; print_r($all_data) ;95 96 $post_data_new = get_post($p_id);97 98 // echo '<pre>' ; print_r($post_data_new) ;99 $i = 0;100 $count = 0;101 102 foreach ($all_data as $a) {103 104 if ($count == count($color_fim)) {105 106 $i = 0;107 $count = 0;108 }109 110 $np_id = $a->ID;111 if ($np_id != $post_id) {112 $post_data_new = get_post($np_id);113 ?>114 115 <div class="col-md-12 no-padding">116 <div class="panel">117 <div class="panel-heading clickable <?php echo $color_fim[$i] ?> cursor-desing">118 <div class="new_fq panel-title">119 <?php echo get_the_title($np_id); ?>120 121 </div>122 <span class="pull-right "><i class="fa fa-minus-circle"></i></span>123 </div>124 <div class="panel-body">125 <?php echo apply_filters('the_content', $post_data_new->post_content); ?>126 </div>127 </div>128 </div>129 <?php130 }131 $i++;132 $count++;133 }134 ?>135 </div>136 </div> -
faq-in-minute/trunk/faq_all.php
r1354025 r1546421 4 4 * Plugin URI: twitter.com/jitendra_popat 5 5 * Description: Create your Faq in just minute. active plugin.go to admin. add new FAQ. and just simple paste this [showallfaq] in your page or in post. use [showallfaq] or [faq-in-minute] to display list of all FAQ. FAQ with modern Design. And for category base [showallfaq category="categoryname"] 6 * Version: 1.66 * Version: 2.0 7 7 * Author: Jiten IT - Jitendra 8 8 * Author URI: twitter.com/jitendra_popat … … 11 11 if (!function_exists('faq_details')) { 12 12 13 // Register CustomPost Type13 // Register faq Post Type 14 14 function faq_in_minute_cat() { 15 16 15 $labels = array( 17 16 'name' => _x('FAQ', 'Post Type General Name', 'text_domain'), … … 30 29 'not_found' => __('Not found', 'text_domain'), 31 30 'not_found_in_trash' => __('Not found in Trash', 'text_domain'), 32 );31 ); 33 32 $args = array( 34 33 'label' => __('faq_in_minute_cat', 'text_domain'), … … 50 49 'publicly_queryable' => true, 51 50 'capability_type' => 'page', 52 );51 ); 53 52 register_post_type('faq_in_minute_cat', $args); 54 53 … … 65 64 'new_item_name' => __('New faqcategory Name'), 66 65 'menu_name' => __('faqcategory'), 67 );66 ); 68 67 69 68 $args = array( … … 74 73 'query_var' => true, 75 74 'rewrite' => array('slug' => 'faqcategory'), 76 );75 ); 77 76 register_taxonomy('faqcategory', array('faq_in_minute_cat'), $args); 78 77 } … … 102 101 'faq_in_minute_cat_settings_section_callback', 103 102 'pluginPage' 104 );103 ); 105 104 add_settings_field( 106 105 'faq_in_minute_cat_text_field_0', … … 109 108 'pluginPage', 110 109 'faq_in_minute_cat_pluginPage_section' 111 );110 ); 112 111 add_settings_field( 113 112 'faq_in_minute_cat_text_field_2', … … 116 115 'pluginPage', 117 116 'faq_in_minute_cat_pluginPage_section' 118 ); 119 add_settings_field( 120 'faq_in_minute_cat_radio_field_3', 121 __( 'Bold Font', 'text_domain' ), 122 'faq_in_minute_cat_radio_field_3_render', 123 'pluginPage', 124 'faq_in_minute_cat_pluginPage_section' 125 ); 126 add_settings_field( 127 'faq_in_minute_cat_select_field_6', 128 __( 'Font Family of FAQ', 'text_domain' ), 129 'faq_in_minute_cat_select_field_6_render', 130 'pluginPage', 131 'faq_in_minute_cat_pluginPage_section' 132 ); 117 ); 118 133 119 } 134 120 function faq_in_minute_cat_text_field_0_render( ) { … … 148 134 <?php 149 135 } 150 function faq_in_minute_cat_radio_field_3_render( ) { 151 152 $options = get_option( 'faq_in_minute_cat_settings' ); 153 $faq_tab_text_bold = $options['faq_in_minute_cat_radio_field_3']; 154 155 if ($faq_tab_text_bold=="") { 156 $faq_tab_text_bold ="bold"; 157 } else { 158 $faq_tab_text_bold = $faq_tab_text_bold ; 159 } ?> 160 Yes <input type='radio' name='faq_in_minute_cat_settings[faq_in_minute_cat_radio_field_3]' <?php checked( $faq_tab_text_bold, 'bold' ); ?> value='bold'> 161 No <input type='radio' name='faq_in_minute_cat_settings[faq_in_minute_cat_radio_field_3]' <?php checked( $faq_tab_text_bold, 'none' ); ?> value='none'> 162 163 <?php 164 } 165 function faq_in_minute_cat_select_field_6_render( ) { 166 167 $options = get_option( 'faq_in_minute_cat_settings' ); 168 ?> 169 <select name='faq_in_minute_cat_settings[faq_in_minute_cat_select_field_6]'> 170 <option value='OpenSansRegular' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'OpenSansRegular'); ?>>OpenSansRegular</option> 171 <option value='Times New Roman' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Times New Roman' ); ?>>Times New Roman</option> 172 <option value='Verdana' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Verdana' ); ?>>Verdana</option> 173 <option value='Lucida Console' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Lucida Console' ); ?>>Lucida Console</option> 174 <option value='Helvetica' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Helvetica' ); ?>>Helvetica</option> 175 <option value='Georgia' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Georgia' ); ?>>Georgia</option> 176 <option value='Arial' <?php selected( $options['faq_in_minute_cat_select_field_6'], 'Arial' ); ?>>Arial</option> 177 </select> 178 179 <?php 180 } 136 181 137 function faq_in_minute_cat_settings_section_callback( ) { 182 138 echo __( 'Display your faq in wordpress page or post using [faq-in-minute] or [showallfaq] shortcodes. From here you can change settings for faq. background color,text color,font family etc. ', 'text_domain' ); … … 200 156 $_SESSION['path'] = ABSPATH; 201 157 202 203 158 extract(shortcode_atts(array( 204 159 "limit" => '', … … 206 161 "faqcategory"=>'', 207 162 "order"=> '', 208 ), $atts));163 ), $atts)); 209 164 210 165 // Define limit 211 if ( $limit) {166 if (!empty($limit)) { 212 167 $posts_per_page = $limit; 213 168 } else { … … 221 176 } 222 177 223 if ($order) {178 if ($order) { 224 179 $ord = $order; 225 180 } else { … … 228 183 229 184 230 if ($faqcategory) {185 if ($faqcategory) { 231 186 $faqcat = $faqcategory; 232 187 } else { 233 188 $faqcat = ''; 234 189 } 235 236 190 include('faq.php'); 237 } 191 192 $args = array( 193 'posts_per_page' => -1, 194 'category_name' => $cat, 195 'faqcategory'=>$faqcat, 196 'orderby' => 'post_date', 197 'order' => $ord, 198 'post_type' => 'faq_in_minute_cat', 199 // 'post_parent' => 0, 200 'post_status' => 'publish', 201 ); 202 203 $output='<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">'; 204 205 $the_query = new WP_Query($args); 206 // echo '<pre>'; print_r($faq_query); die(); 207 208 $i = 1; 209 while ($the_query->have_posts()): 210 $the_query->the_post(); 211 $output .= '<div class="panel panel-default"> 212 <div class="panel-heading faq_heading" role="tab" id="headingOne' . $i . '"> 213 <h4 class="panel-title"> 214 <a data-parent="#accordion" data-toggle="collapse" href="#collapseOne' . $i . '" class="accordion-toggle" aria-expanded="true" aria-controls="collapseOne' . $i . '">' 215 . get_the_title() . '</a></h4> 216 </div> 217 <div class="panel-collapse collapse" id="collapseOne' . $i . '" aria-labelledby="headingOne' . $i . '" role="tabpanel"> 218 <div class="panel-body">' . get_the_content() . '</div> 219 </div> 220 </div>'; 221 $i++; 222 endwhile; 223 wp_reset_postdata(); 224 $output .= '</div>'; 225 return $output; 226 } 238 227 239 228 add_shortcode('showallfaq', 'faq_in_minute_shortcut'); … … 242 231 243 232 function faq_im_scripts() { 244 245 233 246 234 wp_register_style('bootstrapmin', plugin_dir_url(__FILE__) . 'css/bootstrapmin.css'); … … 255 243 function faq_in_minute_script() { 256 244 ?> 257 <script type="text/javascript">258 var $j = jQuery.noConflict();259 $j(document).on('click', '.panel div.clickable', function(e) {260 var $jthis = $j(this);261 if (!$jthis.hasClass('panel-collapsed')) {262 $jthis.parents('.panel').find('.panel-body').slideUp();263 $jthis.addClass('panel-collapsed');264 $jthis.find('i').removeClass('fa-minus-circle').addClass('fa-plus-circle');265 } else {266 $jthis.parents('.panel').find('.panel-body').slideDown();267 $jthis.removeClass('panel-collapsed');268 $jthis.find('i').removeClass('fa-plus-circle').addClass('fa-minus-circle');269 }270 });271 $j(document).ready(function() {272 $j('.panel-heading span.clickable').click();273 $j('.panel div.clickable').click();274 });275 </script>276 245 <?php 277 246 } -
faq-in-minute/trunk/readme.txt
r1434794 r1546421 4 4 Donate link: https://twitter.com/jitendra_popat 5 5 Requires at least: 3.0 6 Tested up to: 4. 56 Tested up to: 4.6.1 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 92 92 == Changelog == 93 93 94 = 2.0 = 95 * solved text above issue in new version. 96 * Updated desing to simple and user friendly. 97 * compatible to latest wordpress version. 98 94 99 = 1.6 = 95 100 * Fix losing color code issue in new version.
Note: See TracChangeset
for help on using the changeset viewer.