445 reputation
29
bio website dynedrewett.com
location Devon, United Kingdom
age 31
visits member for 1 year, 6 months
seen yesterday
stats profile views 22

I'm an IT admin for a firm of solicitors in the South West of England.


May
15
comment Identify the page being shown while in The Loop
Good idea, but returns NULL in this case. get_queried_object_id() then returns 0. Thanks.
May
15
comment Identify the page being shown while in The Loop
@Michael - I've resolved this by adding a 'no_post_id' attribute to the $page_atts array, and then checking this at the relevant point of loop-index.php. Thanks for the advice.
May
15
comment Identify the page being shown while in The Loop
@Michael - Good point about it being destroyed. I'll see if I can knock something up for checking the post_type and let you know. Thanks.
May
15
comment Identify the page being shown while in The Loop
@Michael - I have a custom search Class to handle searches, which outputs to search.php (using loop.php - the_template_part('loop', 'index') - to display the posts). If you look in the Pastebin, you notice that I have set two functions that tell the page what it needs to do in certain situations. So for Careers, for example, the page will output the title and content, and then query any posts of type career, before using loop.php to output them. The issue comes in that while in loop.php, if there are not careers to show, I can't use is_page(), as it doesn't work in The Loop.
May
15
comment Identify the page being shown while in The Loop
Thanks for the comment, but this is not what I'm looking for. The description even specifically notes that this is not for use for post type 'page'.
May
15
revised Identify the page being shown while in The Loop
added 46 characters in body
May
15
comment Identify the page being shown while in The Loop
@Michael - This in my loop.php file. The Loop is used by various templates to display posts, and in the case of two pages, and the search, I need to show some text if there are not matching posts. I've updated with a link to Pastebin that contains my full code for page.php and loop.php. Thanks.
May
15
revised Identify the page being shown while in The Loop
added 46 characters in body
May
15
comment Identify the page being shown while in The Loop
@Patj - Not missing, I just accidentally deleted it for this example code. Added back in now.
May
15
asked Identify the page being shown while in The Loop
May
9
comment Search pagination not working
Good spot, changing to GET fixed it! If you could post as an answer, I will accept. Thanks.
May
9
asked Search pagination not working
Mar
24
awarded  Tenacious
Mar
20
comment set_post_thumbnail_size not cropping featured images
Hmm, your original attempt should have worked. I'll do some testing, there may be an issue with set_post_thumbnail_size() ignoring the crop flag.
Mar
20
comment set_post_thumbnail_size not cropping featured images
You shouldn't have to do that. Using set_post_thumbnail_size() should set post-thumbnail to your desired dimensions, and then the_post_thumbnail() should use post-thumbnail as it's default size, if none is passed.
Mar
20
answered set_post_thumbnail_size not cropping featured images
Mar
20
comment Is there a good way to use CMS images with CSS
I see! I usually just put an explanation in the answer box below, so that if anyone comes across this in the future, then can see why you reached that decision. You can then come back in two days and mark it as the correct answer - people are more likely to help you if you have a good acceptance rate.
Mar
20
comment Is there a good way to use CMS images with CSS
I decided to just have php write the one line of inline css I need and call it done. Haven't you answered that yourself?
Mar
20
comment Redirect page to first post in custom post type
Try echo '<pre>'; print_r($posts); echo '</pre>'; to see what the query is actually grabbing. My guess would be nothing, hence get_permalink() returning the URL of the page you are on. That being the case, is the name of your Post Type correct, or have I mis-typed that?
Mar
20
revised Redirect page to first post in custom post type
added 1 characters in body