paa1605
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to automatically change the category assigned to a post?Thanks for the reply WillxD, much appreciated. I copied and pasted the code you provided into functions.php and changed the time from 604800 to 60 seconds so i could test it, yet i still don’t see anything happening. Am i doing something wrong or is there anything else i need to change? Sorry for the obvious questions but im quite a novice with php.
Thanks,
patrickForum: Fixing WordPress
In reply to: Help with images and aspect ratio in wordpress?Thanks for the help, this worked a treat!
Forum: Fixing WordPress
In reply to: Help needed with php within php codeAwesome!
Much appreciated.
Forum: Fixing WordPress
In reply to: Help needed with php within php code@knut Sparhell
So i don’t need the echo, just
the_time('F, Y');
? It appears to work either way.No i don’t want it to display posts from a date range as i already have that in the code that follows. Its just an h1 tag on the sidebar and i would like it to automatically echo the time period that the posts are showing, which in this case is for the last 7 days. So if today was November 17th it would simply echo ‘posts from November 10-17’. Then tomorrow it would echo ‘posts from November 11-18’ and so on. Is this possible?
Thanks to both of you for your help.
Forum: Fixing WordPress
In reply to: Help needed with php within php codeFantastic, works perfectly! Thanks for that.
I don’t suppose you know if its possible for WordPress to echo a date range? For example, rather than have the above code echo ‘new this week’, is there code that will enable it to echo ‘posts from 10-17 November’ and then on the next day automatically change to echo ‘posts from 11-18 November’ and so on?
Thanks for your help.
Forum: Fixing WordPress
In reply to: Get the category name from the slug? Help needed pleaseWonderful. You saved me hours of head scratching! Many thanks for your kind work.
Forum: Fixing WordPress
In reply to: Get the category name from the slug? Help needed pleaseFantastic vtxyzzy! That solved it.
Its not massively important but do you know if its possible to have this code ignore the ‘dash’ that is used in categories with more than one word? For example, if the category name was ‘new cars’ and the slug was ‘new-cars’, can the code you provided be tweaked so that it echoes the category name with a space rather than a dash?
Thanks ever so much for your help
Forum: Fixing WordPress
In reply to: Get the category name from the slug? Help needed pleaseThanks vtxyzzy for taking the time to reply, much appreciated.
I put in the code you provided but all it did was echo ‘default name here’, not the category_name variable. Should i have replaced this text with something else? If so what, as i couldn’t find anything in the codex that explains this in much detail. Thanks.
Great plug-in Scribu!
Is it possible to display only certain terms from the slug and not all of them in a title? If i use the examples above it returns all the queries. For example, if my slug was
/category_name=clothes&colour=reds&designer=nike
i would just like to output the category_name of ‘clothes’ as a title.
Is this possible? Thanks
Forum: Fixing WordPress
In reply to: Tax_query code not working. Help neededOk so i’ve managed to get this working but for some reason the ‘orderby’ and ‘order’ arguments are being ignored. The posts are shown in the same order no matter what. Any suggestions as to how i can fix this?
$args = array( 'orderby' => 'ID', 'order' => 'DESC', 'posts_per_page' => '3', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'category', 'terms' => array('24'), 'field' => 'term_id',), array( 'taxonomy' => 'post_tag', 'terms' => array('46','47','49','50','51'), 'field' => 'term_id', ), ), );
Forum: Fixing WordPress
In reply to: How to add a background image to a javascript toggle button?Ok, i’ve had a go with jquery and i’ve got the background image to change when clicked, but now the problem i have is that the ul won’t show/hide when the button is clicked!
I have the following code in my category file;
<script type=”text/javascript” src=”https://code.jquery.com/jquery-latest.js”></script>
<script type=”text/javascript”>
$(document).ready(function(){
$(“ul#journal”).hide();
$(“.toggle”).click(function(){
$(this).toggleClass(“active”).next().slideToggle(“slow”);
});
});</script>
And the area that i am trying to hide/show when the link is clicked is named;
<ul id=”journal”>
Can you see what could be causing the problem? I solved my original dilemma but am faced with a new one!
Thanks
Forum: Fixing WordPress
In reply to: How to add a background image to a javascript toggle button?Thanks for the reply rebelit.
Im also not very familiar with javascript and found the code i’m currently using from an old forum post as it was ideal for what i originally intended. I’ve tried a few different modifications to the javascript code but neither have worked. You say its easy to do using jquery? Would you mind expanding on this and pointing me in the right direction as to how i can accomplish the background image change using this method?
Forum: Fixing WordPress
In reply to: How to add a background image to a javascript toggle button?Sorry i just re-read my post and i realised i haven’t explained myself very well. There is an image already applied to the toggle button through the css file as mentioned in rebelit’s reply. What i would like to do is change this background image to another one when the button is clicked. E.g a background image on the toggle button when the div is hidden, and a different image on the button when the div is visible.
How is this possible?
Thanks.
Forum: Fixing WordPress
In reply to: How to create this sort of article using wordpress?Thanks for that, i’ll look into it.
Forum: Fixing WordPress
In reply to: Help needed in adding an 'else' query to some codeThanks for your help David. I’ll have a play with that code and hopefully get it sorted. Cheers