Richard Lyon
Forum Replies Created
-
Ok, thanks.
Looks like I’ll have to resort to using the wordpress uploader.It just seems silly that the featured images have to be uploaded using the wordpress uploader.
Forum: Fixing WordPress
In reply to: Read more is not workingWhen using the more tag are you using
<?php the_content('More...'); ?>
As I don’t think it works withthe_excerpt();
Besides that I am not sure what the problem could be.
The Add New link only gives the option of uploading files.
I want to add already uploaded files to the media library.
Can this even be done?Forum: Fixing WordPress
In reply to: Portfolio tutorial not working.No problem.
Glad it’s working now.
Forum: Fixing WordPress
In reply to: Read more is not workingYeah setting a word limit isn’t really ideal.
If you don’t want to define a manual excerpt or have a fixed length excerpt the only solution I know of is the more tag:
see https://en.support.wordpress.com/splitting-content/more-tag/Basically wherever you put the more tag in each post is where the post will be displayed up until.
Forum: Fixing WordPress
In reply to: How to skip the first post?To make it skip a post I think you just call
the_post();
before entering your while loop. Each time you callthe_post();
it gets the information of the next post.Forum: Fixing WordPress
In reply to: Read more is not workingHave you defined a manual excerpt or placed the more tag in your posts?
Forum: Fixing WordPress
In reply to: How to skip the first post?Could you not just do:
<?php if(have_posts()) { the_post(); while(have_posts()) { the_post(); //Do whatever you need to here. } } ?>
Forum: Fixing WordPress
In reply to: Portfolio tutorial not working.Does it display any php warnings/errors?
Do you have them turned on in your php ini file?That looks to me like your
<?=$website_url?>
is outputting nothing, this could be because the variable is empty. Or because you have output errors turned off in your php ini file and also have short tags turned off.Also it is breaking here
<?php the_post_thumbnail(); ?>
have you enabled post thumbnails?If not you need
add_theme_support( 'post-thumbnails' );
in your functions.php file.Shameless bump.
Forum: Fixing WordPress
In reply to: Portfolio tutorial not working.The php code looks fine to me.
When you view the page source code from the browser does each opening tag have a closing tag and vice versa?
Forum: Fixing WordPress
In reply to: Portfolio tutorial not working.Also you might want to put the post thumbnail inside a check to see if one exists like this:
<?php if(has_post_thumbnail()) : ?> <a href="<?php echo your_link_goes_here; ?>"><?php the_post_thumbnail(); ?></a> <?php endif; ?>
Unless you know for sure that all your posts will have thumbnails.
Forum: Fixing WordPress
In reply to: Portfolio tutorial not working.If this is on a live site a link to see the actual HTML output would be helpful.
Also in your portfolio.php you have
<a>"><?php the_post_thumbnail(); ?> </a>
I’m not sure what that might do to the resulting HTML output but it is definitely wrong.
You want something like :
<a href="<?php echo your_link_goes_here; ?>"><?php the_post_thumbnail(); ?></a>
If you have misordered HTML tags and extra ‘<‘ or ‘>’ it can cause the rest of the HTML to not display or display incorrectly.
Hope this helps.
Forum: Themes and Templates
In reply to: Page listing all posts with a specific category and tagOkay I’ve been looking into this and have come up with :
<?php $category = $_GET['c']; $tag = $_GET['t']; query_posts('cat='.get_cat_id($category).'&tag='.$tag); ?>
Where the url is https://www.example.com/category-tag/?c=projects&t=cpp
What I want to use for the url is :
https://www.example.com/category-tag/projects/cppThe code I would use for this is :
<?php $path = $_SERVER['PATH_INFO']; list($url, $cattag, $category, $tag) = explode('/', $path); query_posts('cat='.get_cat_id($category).'&tag='.$tag); ?>
Which in theory would work but when using ‘/’ slashes after the page ‘category-tag’ word press directs to a search page saying not found and the ‘category-tag’ page template is not executed.
Am I missing something that would allow me to do this?
Or will I have to use the search string after the page?
Or am I going about this all wrong?Thanks!
Forum: Themes and Templates
In reply to: Page listing all posts with a specific category and tagThanks for the reply.
But I am looking for the method to extract the values from the url.I know I could extract the information manually but am wondering if there is a wordpress way of extracting that information.
Like what you put but instead of
'category=projects&meta_value=cpp'
have'category='.url_segment(2).'&meta_value='.url_segment(3)
This way I wouldn’t have to add an extra page and template for each search.Thanks.