Skip to content

Instantly share code, notes, and snippets.

View aalimran07's full-sized avatar
🏠
Working from home

Abdullah AL Imran aalimran07

🏠
Working from home
View GitHub Profile
<?php
/**
* Page Banner Template.
*/
global $post;
$page_header_hide_option = '';
if( is_front_page() ) :
$page_header_hide_option = true;
else :
if(is_404()){
function loanplus_get_excerpt($limit, $source = null){
if($source == "content" ? ($excerpt = get_the_content()) : ($excerpt = get_the_excerpt()));
$excerpt = preg_replace(" (\[.*?\])",'',$excerpt);
$excerpt = strip_shortcodes($excerpt);
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, $limit);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
$excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
return $excerpt;
Copy this file and include it in your theme inc folder then call it by funciton.php
<?php
/**
* Adds nextbuild_latest_post_widget.
*/
class nextbuild_Latest_Post_Widget extends WP_Widget
{
<div class="sidebar-searchbox">
<form action="<?php echo esc_url( home_url( '/' ) ); ?>" method="get">
<input type="text" name="s" placeholder="Search...">
<button type="submit"><i class="fa fa-search"></i></button>
</form>
</div>
if (! function_exists('loanplus_time')) {
function loanplus_time()
{
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
}
$time_string = sprintf(
$time_string,
@aalimran07
aalimran07 / get-redux-data.php
Last active June 3, 2018 06:50
Make function with a global variable for getting data
<!-- Use this code instead including every file global $opt_name
You just copy this code and past it in your theme function.php and then change your options global veriable.
-->
if (! function_exists('redux_options')) {
function redux_options($id, $fallback = false, $key = false)
{
<?php
/**
* Plugin installation and activation for WordPress themes.
*
* Please note that this is a drop-in library for a theme or plugin.
* The authors of this library (Thomas, Gary and Juliette) are NOT responsible
* for the support of your plugin or theme. Please contact the plugin
* or theme author for support.
*
* @package TGM-Plugin-Activation
<?php
add_filter('comment_form_default_fields', 'industryall_comment_form');
function industryall_comment_form($industryall_fields)
{
$industryall_fields['author'] = '<div class="col-sm-4">
<div class="form-group">
<label for="name-cmt">'.esc_html__('Name', 'industryall').' <span>*</span></label>
/*
* custom pagination with bootstrap .pagination class
* source: http://www.ordinarycoder.com/paginate_links-class-ul-li-bootstrap/
*/
function david_post_pagination($echo = true)
{
global $wp_query;
$big = 999999999; // need an unlikely integer