How do I get the WordPress sidebar to show up on a post's detail page? - wordpress

My example is here
I am customizing the default template, but something isn't placed right. Can't figure it out.
By the way, I am asking this here and not at WordPress because frankly, their forums are horrible as far as response times go. Stackoverflow has always done me good :)

Without seeing the php code it'll be hard to know why. Do you have a seprate template for single post ie singlepost.php? If so, make sure you're include sidebar.php into that.
Looks like single.php in the default theme doesn't pull in the sidebar by default. You'll need to add <?php get_sidebar(); ?> right before <?php get_footer(); ?> in single.php or just delete the single.php and wordpress will use index.php instead which has the sidebar.

Related

Removing Comment Section and Date in Wordpress Projects and Posts

I was just wondering if there is a simple way to hide the comment box and date in WP posts and projects. I've followed everything and have unchecked the options under the screen options tab for both projects and posts and they are still showing. Anything other than good old CSS to hide this stuff?
Thanks!
Gerard
You can erase the HTML source code directly in yours templates files.
Open up your theme files, and look for your single.php file.
Look for a post meta section, and simply comment out/delete the part that generates the date, more than likely
<?php the_date(); ?>
Towards the bottom of the single.php file, there will most likely be some code that adds the comments form, again simply delete or comment it out, maybe: <?php comment_form(); ?>

Remove Thumbnail Inside Posts - Wordpress

I am trying to hide the blog post thumbnails inside the blogposts, but at the same time I want to keep the thumbnails in my blog overview.
So far, I used the following CSS to make the thumbnail images disappear:
.attachment-post-thumbnail {display:none;}
However, this also makes them disappear on my blog overview: www.wavebutler.surf/surf-blog
Could anybody help me and let me know what CSS I could use to make the thumbnails disappear inside the posts. It would be very much appreciated!
Not sure if you found your solution or not but, Depending on your themes structure, in single.php look for something like
if(has_post_thumbnail()) :
the_post_thumbnail();
endif;
If you remove it from single.php or comment it out your single posts will no longer have your featured images
This could also be located in content.php which in this case you can just put a conditional statement on it.
if(!is_single()) :
if(has_post_thumbnail()) :
the_post_thumbnail();
endif;
else :
// continue on
endif;
Probably won't be this general as again it will depend on your theme but in a nut shell is how it can be done.

Show all post content on Wordpress

Im using the theme HTML 5 Blank (http://html5blank.com/) with WordPress 3.7.1.
On my page I want to display everthing from the posts, text and images.
In the settings in wordpress admin i have it set on show hole post but it does not work.
I have olso deleted the php code in the loop that inserts the excerpt from the theme. Sitt not workning. Any ideas? I can send code if you want, for now i do not know what code can be usefull.
Jim
Replace <?php the_excerpt() ?>and add the following code to your theme's loop.
<?php the_content(); ?>
That should display the content, rather that the excerpt.

Wordpress ignoring page template from drop down

I am struggling with something that appears to be easy, page templates. I have read plently posts on this, people seem to forget to put the comment at the top of the page and can't get it to show up in the drop down menu on pages. I can do this, my problem is the next stage.
I have written the most basic template (custom-page.php):
<?php
/*
Template Name: Test template
*/
?>
<?php get_header(); ?>
<h1>Teams!</h1>
<?php get_footer(); ?>
It shows up and I can select it on the new page sidebar. However when I visit that new page it seems to have defaulted the archive page using the content template include.
Thanks in advance.
If you put the following in your footer, you should be able to grok some further information about how your template is being selected (and know exactly what might be happening).
<?php global $template;
echo(basename($template)); ?>
Then look for the template name in your footer. It's possible (like #adomnom said) that you have a slug conflict. There are a handful of other strange scenarios that could be caused by plugins, custom functions, or other factors as well.
By the sounds of things, it could be conflicting with another template.
For example, if your page has the slug 'category' and is set to use the custom template 'custom-template.php', it would conflict with (and be overridden by) category.php, which is the default template for showing posts for a specific category.
I recommend changing the slug to see if that's the problem.

Permalink-safe way to link pages inside footer.php

I am currently building a new theme for my site and am kind of stuck not knowing the proper way to link pages together. What is the proper way to direct visitor to another page if I were to write the link straight into footer.php?
Let's consider the following inside footer.php:
?>
A Link
<?php
That would work well up until I were to change my permalink structure to something else.
What is the proper way to do it(without using WP built in menus or anything similar)?
You can use get_permalink assuming your pages are in Wordpress.
See this link: http://codex.wordpress.org/Function_Reference/get_permalink
The above answer is 100% correct, but to save people some time when they stumble upon this question, I took the liberty of writing it out.
<?php echo get_the_title(12); ?>
This covers everything from hover text to dynamic page title, so if you decide to change "Contact" to "Contact Us," you won't have to remember to update the footer.php file.

Resources