-
Author
-
January 11, 2014 at 19:27 #9567
wttribe
ParticipantHello.
I added a sidebar called “Need” and I created a custom post type.
I need to set the “Need” sidebar. Actually it shows the Main sidebar.
How do I have that particular sidebar shown? I thoungt to add
<?php get_sidebar( ‘Need’ ); ?>
in my custom post template, but did not work.
What’s the best way to do it?
thanks
January 12, 2014 at 22:19 #9617Abe
KeymasterHello, Try
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJanuary 13, 2014 at 16:07 #9655wttribe
ParticipantHello, thanks for that. I did it and helped a little. thanks.
Now I have 2 sidebars. The one from the code you told me and the main one.
Here are the 2 files.
My custom theme:
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Sweetdate
* @author SeventhQueen <themesupport@seventhqueen.com>
* @since Sweetdate 1.0
*/get_header( ‘buddypress’ );
global $bp;?>
<?php get_template_part(‘page-parts/general-before-wrap’);?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?><?php
$status=get_post_custom_values(‘status’);
$user_assoc=get_post_custom_values(‘user_assoc’);
$skills=get_post_custom_values(‘skills’);$user_ref = get_userdatabylogin($user_assoc[0]);
$user_now = get_userdata( get_current_user_id() );?>
<?php if($bp->template_message_type==”success”) {
?>
<script> jQuery(document).ready(function ($){ $( “#sharenow” ).dialog({ modal: true, width: 550, height: 210 }); });</script>
<?php$sharetxt=__( ‘I created a new Need on StarTempo!’, ‘kleo_framework’ );
echo “<div id=\”sharenow\” title=\”Share\”><div class=\”textPop\”>”.esc_attr(sprintf(__( ‘Share your new need %s’, ‘kleo_framework’ ), the_title_attribute( ‘echo=0’ ))).”</div>”.ADDTOANY_SHARE_SAVE_KIT( array(“use_current_page” => true,”output_later”=> true, “linkname” => $sharetxt) ).”</div>”;
?><?php }?>
<!– Begin Article –>
<div class=”row<?php if( is_single() && get_cfield(‘centered_text’) == 1) echo ‘ text-center’; ?> <?php _e( $status[0], ‘kleo_framework’);?>”>
<?php do_action( ‘template_notices’ );$members_template->member->id = get_the_author_meta( ‘ID’ );
?>
<div class=”avatar”>
<?php bp_member_avatar(‘type=full&width=94&height=94&class=’); ?>
</div>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<div class=”twelve columns”><?php if(is_single() && get_cfield(‘title_checkbox’) == 1): else: ?>
<?php if ( is_single() ) : ?>
<h2 class=”article-title”>
<?php the_title(); ?>
</h2>
<?php else : ?>
<h2 class=”article-title”>
” title=”<?php echo esc_attr( sprintf( __( ‘Permalink to %s’, ‘kleo_framework’ ), the_title_attribute( ‘echo=0’ ) ) ); ?>” rel=”bookmark”><?php the_title(); ?>
</h2>
<?php endif; // is_single() ?>
<?php endif;?><?php if(get_cfield(‘meta_checkbox’) != 1): ?>
<div class=”article-meta clearfix”>
<ul class=”link-list”>
<?php sweetdate_entry_meta(); ?></div><!–end article-meta–>
<?php endif;?></div><!–end twelve–>
<div class=”userData”><?php
$author = sprintf( ‘%3$s‘,
esc_url( bp_core_get_user_domain( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘kleo_framework’ ), get_the_author() ) ),
get_the_author()
);$ca = xprofile_get_field_data( 300, get_the_author_meta( ‘ID’ ) );
$category = sprintf( ‘%3$s‘,
esc_url( get_search_link($ca) ),
esc_attr( $ca ),
esc_attr( $ca )
);
$p = xprofile_get_field_data( 299, get_the_author_meta( ‘ID’ ) );
$province = sprintf( ‘%3$s‘,
esc_url( get_search_link($p) ),
esc_attr( $p ),
esc_attr( $p )
);
$c = xprofile_get_field_data( 17, get_the_author_meta( ‘ID’ ) );
$city = sprintf( ‘%3$s‘,
esc_url( get_search_link($c) ),
esc_attr( $c ),
esc_attr( $c )
);
$assigned = sprintf( ‘%3$s‘,
esc_url( bp_core_get_user_domain($user_ref->ID) ),
esc_attr( $user_assoc[0] ),
esc_attr( $user_assoc[0] )
);?>
<?php _e( ‘Author’, ‘kleo_framework’ ); ?> <?php echo $author;?><br />
<?php _e( ‘Category’, ‘kleo_framework’ ); ?> <?php echo $category;?><br />
<?php _e( ‘Province/State’, ‘kleo_framework’ ); ?> <?php echo $province;?><br />
<?php _e( ‘City’, ‘kleo_framework’ ); ?> <?php echo $city;?><br /></div>
<?php
if (get_post_thumbnail_id()) { ?>
<div class=”twelve columns”>
<div class=”article-media clearfix”>
<?php the_post_thumbnail();?>
</div><!–end article-media–>
</div><!–end twelve–>
<?php } ?><div class=”twelve columns”>
<div class=”article-content”>
<?php the_content( __( ‘Continue reading <span class=”meta-nav”>→</span>’, ‘kleo_framework’ ) ); ?><div class=”need-status”><?php _e( ‘Status’, ‘kleo_framework’); ?>: <?php _e( $status[0], ‘kleo_framework’);?></div>
<?php if (!empty($user_assoc[0])): ?><div class=”need-assigned”><?php _e( ‘Assigned to’, ‘kleo_framework’ ); ?>: <?php echo $assigned;?></div><?php endif; ?>
<div class=”need-skills”><?php _e( ‘Skills’, ‘kleo_framework’); ?>: <?php echo $skills[0];?></div>
<br /><?php
if (get_the_author_meta( ‘user_nicename’ ) == $user_now->user_login) : ?>
<?php
$icl_object_id = icl_object_id(1025, ‘page’, true);
$icl_object_id2 = icl_object_id(7, ‘page’, true);
?>
” href=”<?php echo get_permalink($icl_object_id ); ?>?user=<?php echo $user_ref->ID; ?>&message=<?php _e(“Payment for Need: “, ‘kleo_framework’);?><?php the_title(); ?>”><?php _e(“Transfer STARS”, ‘kleo_framework’);?><?php elseif($status[0]==”Open”): ?>
</div><!–end article-content–>
</div><!–end twelve–>
</article><!–end article–>
</div><!–end row–>
<!– End Article –><hr>
<?php endwhile; ?>
<?php get_template_part(‘page-parts/general-after-wrap’);?>
<?php get_footer(); ?>
******************************************************************************************
And your general before wrap:
<?php
/**
* Before content wrap
* Used in all templates
*/
?><!– MAIN SECTION
================================================ –>
<section class=”<?php echo apply_filters(‘kleo_main_section_class’, ”);?>”>
<div id=”main”><?php
/**
* Before main part – action
*/
do_action(‘kleo_before_main’);
?><div class=”row”>
<?php /* Before content – action */ ?>
<?php do_action(‘kleo_before_content’); ?><!–begin content–>
<?php
if (sq_option(‘global_sidebar’) == ‘no’)
$content_class = ‘twelve’;
else
$content_class = ‘eight’;
?>
<div class=”<?php echo apply_filters(‘kleo_content_class’,$content_class); ?> columns”>************************************************************************************
What’s the best way to get rid of the main sidebar and have the custom one?
Hope you can help me. Thanks
-
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.