Plugin Directory

Changeset 2591395


Ignore:
Timestamp:
08/31/2021 10:04:59 AM (5 years ago)
Author:
rajeevglocify
Message:

change the custom bg color in btn

Location:
load-more-posts/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • load-more-posts/trunk/inc/setting-form.php

    r2489602 r2591395  
    88    if(empty($_POST['wp_hide_btn_Txt'])){$_POST['wp_hide_btn_Txt']="Load Less";}
    99    if(empty($_POST['wp_post_excerpt_content'])){$_POST['wp_post_excerpt_content']="120";}
    10     $result = array('wp_load_posts_date'=>sanitize_text_field($_POST['wp_load_posts_date']),'wp_load_posts_comment'=>sanitize_text_field($_POST['wp_load_posts_comment']),'wp_load_post_category'=>sanitize_text_field($_POST['wp_load_post_category']),'wp_load_default_col'=>sanitize_text_field($_POST['wp_load_default_col']),'wp_post_per_page'=>sanitize_text_field($_POST['wp_post_per_page']),'wp_load_more_btn_Txt'=>sanitize_text_field($_POST['wp_load_more_btn_Txt']),'wp_hide_btn_Txt'=>sanitize_text_field($_POST['wp_hide_btn_Txt']),'wp_post_excerpt_content'=>sanitize_text_field($_POST['wp_post_excerpt_content']),'wp_load_less_Btn'=>sanitize_text_field($_POST['wp_load_less_Btn']));
     10    if(empty($_POST['wp_load_more_Bg_color'])){$_POST['wp_load_more_Bg_color']="#CC1919";}
     11    if(empty($_POST['wp_load_more_Tx_color'])){$_POST['wp_load_more_Tx_color']="#fff";}
     12    if(empty($_POST['wp_load_more_Hbg_color'])){$_POST['wp_load_more_Hbg_color']="#9c0505";}
     13    if(empty($_POST['wp_load_more_Htx_color'])){$_POST['wp_load_more_Htx_color']="#fff";}
     14    $result = array('wp_load_posts_date'=>sanitize_text_field($_POST['wp_load_posts_date']),'wp_load_posts_comment'=>sanitize_text_field($_POST['wp_load_posts_comment']),'wp_load_post_category'=>sanitize_text_field($_POST['wp_load_post_category']),'wp_load_default_col'=>sanitize_text_field($_POST['wp_load_default_col']),'wp_post_per_page'=>sanitize_text_field($_POST['wp_post_per_page']),'wp_load_more_btn_Txt'=>sanitize_text_field($_POST['wp_load_more_btn_Txt']),'wp_hide_btn_Txt'=>sanitize_text_field($_POST['wp_hide_btn_Txt']),'wp_post_excerpt_content'=>sanitize_text_field($_POST['wp_post_excerpt_content']),'wp_load_less_Btn'=>sanitize_text_field($_POST['wp_load_less_Btn']),'wp_load_more_Bg_color'=>sanitize_text_field($_POST['wp_load_more_Bg_color']),'wp_load_more_Tx_color'=>sanitize_text_field($_POST['wp_load_more_Tx_color']),'wp_load_more_Hbg_color'=>sanitize_text_field($_POST['wp_load_more_Hbg_color']),'wp_load_more_Htx_color'=>sanitize_text_field($_POST['wp_load_more_Htx_color']));
    1115    foreach($result as $key=>$val){
    1216        delete_option($key);
     
    2226<tbody>
    2327<tr>
    24 <th scope="row">Date</th>
    25 <td> <fieldset><label for="wp_load_posts_date">
    26 <input name="wp_load_posts_date" type="checkbox" id="wp_load_posts_date" value="1" <?php if(!empty(get_option('wp_load_posts_date'))){echo 'checked';}?> >
    27     Hide Date</label>
    28 </fieldset></td>
     28<th>Date</th>
     29<td>
     30<input name="wp_load_posts_date" type="checkbox" id="wp_load_posts_date" value="1" <?php if(!empty(get_option('wp_load_posts_date'))){echo 'checked';}?> > Hide Date</td>
    2931</tr>
    3032<tr>
    31 <th scope="row">Comments</th>
    32 <td> <fieldset><label for="wp_load_posts_comment">
     33<th>Comments</th>
     34<td>
    3335<input name="wp_load_posts_comment" type="checkbox" id="wp_load_posts_comment" value="1" <?php if(!empty(get_option('wp_load_posts_comment'))){echo 'checked';}?> >
    34     Hide Comments Count</label>
    35 </fieldset></td>
     36    Hide Comments Count</td>
    3637</tr>
    3738<tr>
    38 <th scope="row">Category</th>
    39 <td> <fieldset><label for="wp_load_post_category">
     39<th>Category</th>
     40<td>
    4041<input name="wp_load_post_category" type="checkbox" id="wp_load_post_category" value="1" <?php if(!empty(get_option('wp_load_post_category'))){echo 'checked';}?>>
    41     Hide Category</label>
    42 </fieldset></td>
     42    Hide Category</td>
    4343</tr>
    4444<tr>
    45 <th scope="row">Posts Style</th>
     45<th>Posts Style</th>
    4646<td>
    4747<select name="wp_load_default_col" class="regular-text">
     
    5454</tr>
    5555<tr>
    56 <th scope="row"><label>Load Posts per Click</label></th>
     56<th>Load Posts per Click</th>
    5757<td><input name="wp_post_per_page" type="number" id="wp_post_per_page" class="regular-text" placeholder="Default:10" value="<?php echo get_option('wp_post_per_page');?>"></td>
    5858</tr>
    5959<tr>
    60 <th scope="row">Load More Button Text</th>
    61 <td> <fieldset><label for="wp_load_more_btn_Txt">
    62 <input name="wp_load_more_btn_Txt" type="text" class="regular-text" id="wp_load_more_btn_Txt" value="<?php echo get_option('wp_load_more_btn_Txt');?>" placeholder="Default: Load More"></label>
    63 </fieldset></td>
     60<th>Load More Button</th>
     61<td>Button Text: <input style="max-width: 285px;" name="wp_load_more_btn_Txt" type="text" class="regular-text" id="wp_load_more_btn_Txt" value="<?php echo get_option('wp_load_more_btn_Txt');?>" placeholder="Default: Load More"><br><br>
     62Button Background Color: <input style="max-width: 200px;" name="wp_load_more_Bg_color" type="text" class="regular-text" id="wp_load_more_Bg_color" value="<?php  if(!empty(get_option('wp_load_more_Bg_color'))){echo get_option('wp_load_more_Bg_color');}else {echo "#CC1919";}?>" placeholder="Default: #CC1919"><br><br>
     63Button Text Color: <input style="max-width: 248px;" name="wp_load_more_Tx_color" type="text" class="regular-text" id="wp_load_more_Tx_color" value="<?php  if(!empty(get_option('wp_load_more_Tx_color'))){echo get_option('wp_load_more_Tx_color');}else {echo "#fff";}?>" placeholder="Default: #fff"><br><br>
     64Button Hover Background Color: <input style="max-width: 158px;" name="wp_load_more_Hbg_color" type="text" class="regular-text" id="wp_load_more_Hbg_color" value="<?php  if(!empty(get_option('wp_load_more_Hbg_color'))){echo get_option('wp_load_more_Hbg_color');}else {echo "#9c0505";}?>" placeholder="Default: #9c0505"><br><br>
     65Button Hover Text Color: <input style="max-width: 207px;" name="wp_load_more_Htx_color" type="text" class="regular-text" id="wp_load_more_Htx_color" value="<?php if(!empty(get_option('wp_load_more_Htx_color'))){echo get_option('wp_load_more_Htx_color');}else {echo "#fff";}?>" placeholder="Default: #fff">
     66</td>
    6467</tr>
    6568<tr>
    66 <th scope="row">Load Less</th>
    67 <td> <fieldset><label for="wp_load_less_Btn">
    68 <input name="wp_load_less_Btn" type="checkbox" id="wp_load_less_Btn" value="1" <?php if(!empty(get_option('wp_load_less_Btn'))){echo 'checked';}?>>
    69     Hide Load Less Button</label>
    70 </fieldset></td>
     69<th>Load Less</th>
     70<td><input name="wp_load_less_Btn" type="checkbox" id="wp_load_less_Btn" value="1" <?php if(!empty(get_option('wp_load_less_Btn'))){echo 'checked';}?>>
     71    Hide Load Less Button</td>
    7172</tr>
    7273<tr>
    73 <th scope="row">Load Less Button Text</th>
     74<th>Load Less Button Text</th>
    7475<td><input name="wp_hide_btn_Txt" type="text" class="regular-text" id="wp_hide_btn_Txt" value="<?php echo get_option('wp_hide_btn_Txt');?>" placeholder="Default: Load Less">
    7576</td>
     
    7778<tr>
    7879<tr>
    79 <th scope="row"><label>Excerpt Content (Character)</label></th>
     80<th>Excerpt Content (Character)</th>
    8081<td><input name="wp_post_excerpt_content" type="number" id="wp_post_excerpt_content" class="regular-text" placeholder="Default:120" value="<?php echo get_option('wp_post_excerpt_content');?>"></td>
    8182</tr>
    82 <th scope="row">Shortcode</th>
     83<th>Shortcode</th>
    8384<td><b>All Posts:</b> [wp_load_more_option] --OR-- [wp_load_more_option cat_id=""]<br>
    8485<b>Any Category:</b> [wp_load_more_option cat_id="1"] ***Where 1 is category id***<br>
  • load-more-posts/trunk/loadmorepost.php

    r2577179 r2591395  
    44* Plugin URI:
    55* Description: A Plugin to add Load More Posts option. Use shortcode (see admin setting...) to display all posts for any page.
    6 * Version: 1.2.3
     6* Version: 1.2.4
    77* Author: Rajeev Chauhan
    88* Author URI: mailto:rajeev.glocify@gmail.com
     
    105105       );
    106106    $results = get_posts($args);
     107    $background1 = !empty(get_option('wp_load_more_Bg_color')) ? get_option('wp_load_more_Bg_color'):'#CC1919';
     108    $background2 = !empty(get_option('wp_load_more_Tx_color')) ? get_option('wp_load_more_Tx_color'):'#fff';
     109    $background3 = !empty(get_option('wp_load_more_Hbg_color')) ? get_option('wp_load_more_Hbg_color') : "#9c0505";
     110    $background4 = !empty(get_option('wp_load_more_Htx_color')) ? get_option('wp_load_more_Htx_color'):"#fff";
     111        $html .= '<style>.wp_load-more {background:'.$background1.'!important;color:'.$background2.'!important}
     112    button.wp_load-more:hover {color:'.$background4.'!important;}
     113    .wp_load-more::after {background:'.$background3.' !important;}</style>';
    107114    $html .='<div class="wp_all_posts_section">';
    108115        if(get_option('wp_load_default_col')==2){
Note: See TracChangeset for help on using the changeset viewer.