$permalink = get_permalink(); $remove_link = get_post_meta($post->ID, 'rttheme_portf_no_detail', true); $custom_thumb = get_post_meta($post->ID, 'rttheme_portfolio_thumb_image', true); $project_info = get_post_meta($post->ID, 'rttheme_project_info', true); $featured_image_usage = get_post_meta($post->ID, 'rttheme_featured_image_usage', true); $post_uniqueID = 'portfolio-post-' . get_the_ID() . ''; $portfolio_format = get_post_meta($post->ID, 'rttheme_portfolio_post_format', true); $password_protected = post_password_required($post) ? true : false; // Password Protected //project key details to add before sidebar if (trim($project_info)) { $before_sidebar = '<div class="box first box-shadow box_layout widget project_notes">'; $before_sidebar .= '<div class="head_text nomargin"><div class="arrow"></div><h4>'; $before_sidebar .= get_post_meta($post->ID, 'rttheme_project_info_title', true); $before_sidebar .= '</h4><div class="space margin-b10"></div></div>'; $before_sidebar .= do_shortcode(fixshortcode(wpautop(str_replace("<ul", '<ul class="check"', $project_info)))); $before_sidebar .= '</div>'; } else { $before_sidebar = ""; } //next and previous links if (get_option(THEMESLUG . '_hide_portfolio_navigation')) { $prev = is_array($terms) ? mod_get_adjacent_post(true, true, '', 'portfolio_categories', 'date') : get_adjacent_post("", "", true); $next = is_array($terms) ? mod_get_adjacent_post(true, false, '', 'portfolio_categories', 'date') : get_adjacent_post("", "", false); $prev_post_link_url = $prev ? get_permalink($prev->ID) : ""; $next_post_link_url = $next ? get_permalink($next->ID) : ""; $next_post_link = $next_post_link_url ? '<a href="' . $next_post_link_url . '" title="" class="p_next"><span>' . __('Next →', 'rt_theme') . '</span></a>' : false; $prev_post_link = $prev_post_link_url ? '<a href="' . $prev_post_link_url . '" title="" class="p_prev"><span>' . __('← Previous', 'rt_theme') . '</span></a>' : false; $add_class = $prev_post_link == false ? "single" : ""; // if previous link is empty add class to fix white border $before_sidebar .= $next_post_link || $prev_post_link ? '<div class="post-navigations margin-b20 ' . $add_class . '">' . $prev_post_link . '' . $next_post_link . '</div>' : "";
function hg_alert($atts, $content = null) { // [alert type=""]...[/alert] // info, success, danger, error $content = wpautop(do_shortcode($content)); $content = fixshortcode($content); extract(shortcode_atts(array("type" => 'info'), $atts)); return '<div class="alert alert-' . $type . '">' . $content . '</div>'; }
function hg_row($atts, $content = null) { //[row class="" fluid="no" container="no"][/row] $content = wpautop(do_shortcode($content)); $content = fixshortcode($content); extract(shortcode_atts(array("class" => '', "container" => 'no', "fluid" => 'no'), $atts)); $overlayToggle = ''; $ovScript = ''; if (strpos($class, 'show_id')) { $overlayToggle = '<div class="' . $GLOBALS['bcol'] . '12"><a href="#" id="hideOverlayModules" class="btn btn-primary" style="margin-bottom:30px;">Hide the modules overlay with ID</a></div>'; $ovScript = ' <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#hideOverlayModules").toggle(function(e) { jQuery(".' . ($fluid == 'yes' ? 'row-fluid' : 'row') . '.all_modules").removeClass("show_id"); jQuery(this).text("SHOW the modules overlay with ID."); jQuery(this).removeClass("btn-primary"); }, function() { jQuery(".' . ($fluid == 'yes' ? 'row-fluid' : 'row') . '.all_modules").addClass("show_id"); jQuery(this).text("HIDE the modules overlay with ID."); jQuery(this).addClass("btn-primary"); }); }); </script> '; } $html = $container == 'yes' ? '<div class="container">' : ''; $html .= '<div class="' . ($fluid == 'yes' ? 'row-fluid' : 'row') . ' ' . $class . '">' . $overlayToggle . ' ' . $content . '</div>' . $ovScript; $html .= $container == 'yes' ? '</div>' : ''; return $html; }
function rt_shortcode_show_shortcode($atts, $content = null) { //convert html [] spacial chars //fix shortcode $content = fixshortcode($content); $content = preg_replace('#<br \\/>#', "", trim($content)); $content = preg_replace('#<p>#', "", trim($content)); $content = preg_replace('#<\\/p>#', "", trim($content)); $content = preg_replace('#\\[\\/braket_close\\]#', "[/show_shortcode]", trim($content)); return '<code>' . htmlspecialchars($content) . '</code>'; }
function hg_error($atts, $content = null) { // [error code=""]...[/error] //fix shortcode $content = wpautop(do_shortcode($content)); $content = fixshortcode($content); extract(shortcode_atts(array("code" => ''), $atts)); $html = array(); $html[] = '<div class="row">'; $html[] = ' <div class="col-sm-12">'; $html[] = ' <div class="error404">'; $html[] = ' <h2><span>' . $code . '</span></h2>'; $html[] = ' <h3>' . $content . '</h3>'; $html[] = ' </div>'; $html[] = ' </div>'; $html[] = '</div>'; return implode("\n", $html); }