Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNathan Barlcay
4,547 PointsPermalinks and image uploads don't appear to be working as in the video...
http://localhost/localwp.com/portfolio/portolio/ Permalink: http://localhost/localwp.com/portfolio/pink-star/ don't appear to be able to load, I'm following the video but not getting anywhere with this issue.
Any help would be appreciated?.
Thanks, NB
5 Answers
jason chan
31,009 Pointsyou have to enable mod rewrite on your xampp.
To enable this module it just takes a little tweak of your httpd.conf file which will be found in xampp\apache\conf. The conf file already contains the line needed to enable the module, but there is a comment mark (#) just before the code which means Apache will ignore the code. The line you are looking for is:
#LoadModule rewrite_module modules/mod_rewrite.so
delete pound sign and save
Nathan Barlcay
4,547 PointsHi Jason,
Thank you for your response much appreciated.
I've checked the pound sign and it wasn't commented out. Equally I'm using MAMP Apache, however the line of code was there, held within the file you suggested. Was good to rule this out or though I've never come across this before.
Thanks, NB
Zac Gordon
Treehouse Guest TeacherHave you been able to load your site properly before this? What code were you adding when it stopped working? Do you have actual code in your template files? What happens when you use a default WP theme?
Nathan Barlcay
4,547 PointsHello Zac,
For some reason the code below which is provided in the tutorial, does not match the page-portfolio.php (treehouse-portfolio theme) code.
page-portfolio.php (my work put together watching the video tutorials)
<?php
/*
Template Name: Portfolio Page
*/
?>
<?php get_header(); ?>
<section class="row">
<div class="small-12 columns text-center">
<div class="leader">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<hr>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
</section>
<?php
$args = array(
'post_type' => 'portfolio'
);
$query = new WP_Query( $args );
?>
<section class="row no-max pad">
<?php if( $query->have_posts() ) : while( $query->have_posts() ) : $query->the_post(); ?>
<div class="small-6 medium-4 large-3 columns grid-item">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('large'); ?></a>
<?php endwhile; endif; wp_reset_postdata(); ?>
</section>
<?php get_footer(); ?>```
page-portfolio.php (treehouse-portfolio theme)
```<?php
/*
Template Name: Portfolio Page
*/
?>
<?php get_header(); ?>
<section class="row">
<div class="small-12 columns text-center">
<div class="leader">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
</div>
</section>
<?php get_template_part('content', 'portfolio'); ?>
<?php get_footer(); ?>```
Nathan Barlcay
4,547 PointsIf I try the treehouse-portfolio theme the images seem to work properly, however if I update the code above on the theme I've been working on, it won't load the images.
I have to say I'm left a little confused by the findings, firstly the "page-portfolio.php (treehouse-portfolio theme)" code does not represent the video tutorial, second the treehouse-portfolio theme obviously has the correct code but I don't have any explanation as to why, thirdly when I update the page-portfolio.php (treehouse-portfolio theme) code to my own theme via Sublime text editor it does not load any images at all?? This leaves me to think that there may be additional issues to fix in order to move forward.
I'm sure there is a simple explanation to this and if you can advise to help me get back on track that would be much appreciated.
Thanks, NB
Israel Sepulveda
823 PointsI seem to be having the same issue. I went in the content-portfolio.php file and found the code that zac added in the page-portfolio.php. I copied and pasted the code into my page-portfolio.php file and it still didn't work. I've watched the videos 3 times now to see if I missed a step and nothing.