WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [theme: Custom Community] Templates not showing (36 posts)

  1. Andeh86
    Member
    Posted 2 years ago #

    Hi guys,

    im trying to set pages to have different templates, looking at the actual site for custom community there should be a list of templates when you create a new page (as shown here:
    http://www.custom-community.themekraft.com/page-templates-2/ )

    I only have 'default', 'full width' and 'Links. Does any one know how i can get the rest of them there? ive googled around for days but cant find an answer!

    When i look in the template settings all of them show up to set as the default, but i need access to all of them!

    Hope you can help.

    Andeh

  2. Andeh86
    Member
    Posted 2 years ago #

    Any one got any ideas?

  3. Andeh86
    Member
    Posted 2 years ago #

    I made a fix myself... i did it by creating my own template. it wasnt the easiest of solutions for some one who is just starting out on wordpress, but if any one wants to know the code i used then let me know.

    What i did was created a template to have left and right side bars and set the left side bar as default.

  4. deepbevel
    Member
    Posted 2 years ago #

    Great! maybe you can assist me, I need a custom full width template, no sidebars. So far I can't do it, even with cc premieum support! Seems no one can say what makes the templates get their sidebars. perhaps you discovered the secret?

    thanks!

  5. Andeh86
    Member
    Posted 2 years ago #

    What do you mean custom full width template? because you can set the template to be full with on each page as default?

  6. deepbevel
    Member
    Posted 2 years ago #

    I know, but I need it as my attachment page. That can't be set as default except through template code.

    Also, I want an additional custom full width page template, but there's no way to specify full width in the template code, it comes from the header, somehow. I've been in contact with premium support, they can't seem to do it either.

  7. Andeh86
    Member
    Posted 2 years ago #

    When i created my template to have the two side bars i created a new PHP file with the following at the top:

    <?php
    /*template name: insert-name
    */?>

    If you create a .php file with only that in it, place it in your template folder, it will create a new item in the dropdown for your templates in the 'attribute' window.

    then i placed the code i needed underneith the title code and created the template i needed.

    I dont quite understand what you mean by a custom full width template, how custom can full width get other than full width with no side bars? which is a default template already provided.

    I had to create a right hand side bar just for about 4 pages, and keep the others as a left hand side bar, so i created my L+R template and then set the default to left side bar. This then gave me the option of full width, left, or left and right.

    Can you explain further what you mean by a full width template? and i might be able to help further.

  8. deepbevel
    Member
    Posted 2 years ago #

    it's the same full width template as default, but it includes custom queries and some specific css. Not too unussual for a custom page really.

    However my main goal is to get a full width attachment template. Don't you find it odd that the cc theme has a sidebar on it's attachment page? And even odd-er, the attachment page template doesn't show image attachments. So I had to make a custom template to show images. Still, I can't make it full width.

    I had to create a right hand side bar just for about 4 pages, and keep the others as a left hand side bar, so i created my L+R template and then set the default to left side bar. This then gave me the option of full width, left, or left and right.

    If you know how to tell custom community templates how many sidebars they should have, I'm all ears. What was the code used to get the different sidebar configs?

    THanks!

  9. deepbevel
    Member
    Posted 2 years ago #

    Here's my site, On the map click "CA" then "Bakersfield", you'll see the post below the map. Click a post image and you'll see my attachment page that I'd like full width and no sidebars.
    site

  10. Andeh86
    Member
    Posted 2 years ago #

    the code i used was an omalgimation from the page.php and sidebar.php code. It is pretty fudged but it works fantastically as long as no page content is straight copied from word(an error i found, but not uncommon)

    <?php /*template name: L+R side bars
    */?>
    
    <?php get_header() ?>
    
    	<div id="content" >
    <?php do_action( 'bp_before_sidebar' ) ?>
    <div class="v_line v_line_right"></div>
    <div id="sidebar" class="widgetarea">
    	<div class="right-sidebar-padder">
    
    	<?php do_action( 'bp_before_after_sidebar' ) ?>
    	<?php if( ! dynamic_sidebar( 'sidebar' )): ?>    
    
    	<?php if ( is_singular() ) { ?>
    		<div class="widget">
    			<h3 class="widgettitle" ><?php _e('Recent Posts', 'cc'); ?></h3>
    			<ul>
    				<?php
    				$myposts = get_posts('numberposts=5&offset=0&category=0');
    				foreach($myposts as $post) : setup_postdata($post);
    				?>
    				<li><span><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span></li>
    				<?php endforeach; ?>
    			</ul>
    		</div>
    	<?php } else { ?>
    		<div class="widget">
    			<h3 class="widgettitle" ><?php _e('Random Posts', 'cc'); ?></h3>
    			<ul>
    				<?php
    				$rand_posts = get_posts('numberposts=5&orderby=rand');
    				foreach( $rand_posts as $post ) :
    				?>
    				<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    				<?php endforeach; ?>
    			</ul>
    		</div>
    	<?php } ?>
    	<div class="widget tags">
    		<h3 class="widgettitle" ><?php _e('Search by Tags!', 'cc'); ?></h3>
    		<div><?php wp_tag_cloud('smallest=9&largest=18'); ?></div>
    	</div>
    	<div class="widget">
    		<h3 class="widgettitle" ><?php _e('Archives', 'cc'); ?></h3>
    		<ul>
    			<?php wp_get_archives( 'type=monthly' ); ?>
    		</ul>
    	</div>
    	<div class="widget">
    		<h3 class="widgettitle" ><?php _e('Links', 'cc'); ?></h3>
    		<ul>
    			<?php wp_list_bookmarks('title_li=&categorize=0&orderby=id'); ?>
    		</ul>
    	</div>
    	<div class="widget">
    		<h3 class="widgettitle" ><?php _e('Meta', 'cc'); ?></h3>
    		<ul>
    			<?php wp_register(); ?>
    			<li><?php wp_loginout(); ?></li>
    			<?php wp_meta(); ?>
    		</ul>
    	</div>
    
    	<?php endif; // end primary widget area ?>
    
    	<?php do_action( 'bp_inside_after_sidebar' ) ?>
    
    	</div><!-- .padder -->
    </div><!-- #sidebar -->
    
    <?php do_action( 'bp_after_sidebar' ) ?>
    		<div class="padder">
    
    <?php do_action( 'bp_after_sidebar' ) ?>
    
    		<?php do_action( 'bp_before_blog_page' ) ?>
    
    	<div class="page" id="blog-page" >
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    				<h2 class="pagetitle"><?php the_title(); ?></h2>
    
    				<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    					<div class="entry">
    <table style="width: 500px;">
    <tbody>
    <tr>
    <td>
    						<?php the_content( __( '<p class="serif">Read the rest of this page &rarr;</p>', 'cc' ) ); ?>
    						<div class="clear"></div>
    						<?php wp_link_pages( array( 'before' => __( '<p class="cc_pagecount"><strong>Pages:</strong> ', 'cc' ), 'after' => '</p>', 'next_or_number' => 'number')); ?>
    </td>
    </tr>
    </tbody>
    </table>
    					</div>
    					<div class="clear"></div>
    
    				</div>
    
    			<?php endwhile; endif; ?>
    
    		</div><!-- .page -->
    		<?php cc_list_posts_on_page(); ?> 
    
    		<div class="clear"></div>
    
    		<?php edit_post_link( __( 'Edit this page.', 'cc' ), '<p class="edit-link">', '</p>'); ?>
    
    		</div><!-- .padder -->
    	</div><!-- #content -->
    
    <?php get_footer() ?>

    This is the whole code, let me know how it fairs for you, as far as im aware i didnt do anything else than create this .php file and stick it in the templates root folder. (i.e /wp-content/templates/custom community/ (this automatically gives you a new template dropdown))

    Like i said before what you could do is try copy the actual content from the full-width.php and stick it into a new PHP file called somethike customFW.php or some thing like that. I dont know how well that would work though, and then add in your own custom code to that file and see how you get on.

    dont forget to give your template a name though using

    <?php
    /*template name: insert-name
    */?>
  11. Andeh86
    Member
    Posted 2 years ago #

    wow, clicking Bakersfield is near impossible, im guessing your changing that? i had to zoom in on the site to view it!

    Have you tried using firebug to edit the code and see what needs changing? im guessing you just need to remove the padding on the sides to get the full site? i just gave it a go. and that gave me a full view of everything. im guessing thats your issue? the padding is cutting off the sides of the page?

  12. deepbevel
    Member
    Posted 2 years ago #

    Thats the point of the zoom. There's going to be too many locations to show them all big. I'll make the "please zoom" message bigger. But thanks for the feedback.

    I'm well versed in creating custom pages, this is a special case, as you know by what you had to do to control sidebars. It's not easy with this theme, not even for the premium support staff, they couldn't (or wouldn't) do it.
    Thanks so much for the code, I'll play with it. The CC staff may be intersted in it too.

    I reccomend firebug all the time, been using it extencively for this project. Feel free to take a crack at it!

    Thanks so much!

    I copied your code before it gets dumped, it's too long for the forums. Use pastebin :)

  13. Andeh86
    Member
    Posted 2 years ago #

    I think it may be a case of 'wouldnt' do it more than could'nt, what with the fact they created the theme, but hey ho! they may take your advice and add a new module into a theme update! let me know how the template goes for you, ide be interested to see what you come up with.

    I didnt realise that this forum had a code limit on it, so i shall use pastebin from now on on here! thanks.

  14. deepbevel
    Member
    Posted 2 years ago #

    odd, I don't see where it calls the left and right sidebars.. and I see specific "widget areas" defined.. Are these custom sidebars? did you have to register them in functions.php? I'm not sure what I'm looking at here.

  15. deepbevel
    Member
    Posted 2 years ago #

    i just gave it a go. and that gave me a full view of everything

    I'd love to see the css which produced this, I couldn't locate it in firebug. I'm more than willing to create new padder descriptions in css for this template.

  16. Andeh86
    Member
    Posted 2 years ago #

    do you have the latest version of the custom community theme? because all the code i used relates back to files that are located in the theme template folders.

    I definatly didnt change the functions.php, just created the new .PHP

    the custom widgets that are in there are for if you have no widgets assigned to the right hand side bar, it automatically puts something there. there is a style.php which has a shed load of code that is for the main frame work of the site that is located in this route:
    custom-community\core\includes\theme-generator

    Try load that file into notepad++ and do a ctrl+f for the section your looking to change. Though looking at your site now it looks fixed, have you changed anything?

  17. Andeh86
    Member
    Posted 2 years ago #

    that, and ive just realised i gave you the wrong code i used, that was a fudged one...

    This one is cleaner...

    http://pastebin.com/V22sqdwX

  18. deepbevel
    Member
    Posted 2 years ago #

    I have the latest version.

    A person would be my hero if they could point me to said code. I can't find any code which essentially says "no sidebars on the full width template".

    thanks, I now understand, your widget areas in the template are the "dynamic sidebars". So no new sidebar code was added.

    Thanks for the update on the code, I'll see what I can do with it asap.

    It's true, the attachment pages look okay with the emply left and right sidebars, almost simulates full width, but it's just faking it :) I'd prefer the real deal as I still have much to do with this project, controlling the sidebars will be essential.

  19. deepbevel
    Member
    Posted 2 years ago #

    I would expect other cc users might want an attachment page that can show images, if so here's my code for that:

    cc-image-attachment-template

  20. deepbevel
    Member
    Posted 2 years ago #

    my css:

    [CSS moderated as per the Forum Rules. Please just post a link to your site.]

  21. Crew Pass
    Member
    Posted 1 year ago #

    @deepbevel

    I am using Custom Community Pro with Buddypress and after I upgraded to the new buddypress 1.6 some of buddypress options have stopped working. When I say stopped working what happens is some of the pages are 3 columns as i have set it and then some pages are full width.

    After reading your post above I wanted to ask if you think adding your code would help me to ensure that all my pages are 3 columns and not full width.

    Thanks
    Chris

  22. Crew Pass
    Member
    Posted 1 year ago #

    Sorry I should have @Andeh86

  23. deepbevel
    Member
    Posted 1 year ago #

    If you have the pro version you have premium support. And their support is really great, I'm sure they'll help you.

  24. Crew Pass
    Member
    Posted 1 year ago #

    Thanks,

    I'll message them now and see how I get on.

  25. deepbevel
    Member
    Posted 1 year ago #

    I know there's been a planned update for some time now, still waiting. Oddly enough I'm not currently using it with buddypress, but I can say everything still works fine with the latest wp, and I have a lot of plugins.

    In the mean time you may try and disable buddypress just to see if the issue is then resolved, just to have a better idea. Yuo may have to roll back untill cc is updated.

    good luck.

  26. Crew Pass
    Member
    Posted 1 year ago #

    Thanks for getting back to me. I did contact Custom Community and they said that I can set the page layout on each page. So I had to go to each effected page and set it to right & left columns and how it is working. They said that the new buddypress 1.6.1 has given them problems that they are working on fixing.

  27. deepbevel
    Member
    Posted 1 year ago #

    good show.
    I made an image
    attachment template
    for that theme, thought it was odd their default attachment template didn't show images. They may include it in the next version.

  28. tednopple
    Member
    Posted 1 year ago #

    But has anyone found out why this happens.

    I am having the same problem. For some reason, the sidebar templates are NOT showing up in my templates list!

    I don't know enough to code to these tricks. Plus I am wanting to create one page with both left and right sidebars and the rest of my site with just one right sidebar.

  29. Andrew
    Forum Moderator
    Posted 1 year ago #

    I'm sure someone will be able to help, Tednopple, but within your own thread.

  30. Andeh86
    Member
    Posted 1 year ago #

    Are you looking at page templates i.e. when you go to pages - edit page - select the drop down for template?

    If this is the case, make sure that you have labeled your .php file at the top with the following:

    <?php
      /*
        template name: [insert-name-here]
      */
    ?>

    And it will show up in your list. If not, more specific on what list your talking about?

Topic Closed

This topic has been closed to new replies.

About this Topic