Forum Replies Created
-
AuthorPosts
-
deejukMember
Hi Brad - you're smarter than me for certain.. I need to study more
deejukMemberHi ... thanks for the lead on this I have worked it out now with your help.
I tired the following code in my category-4.php template
add_action( 'pre_get_posts', 'generate_random_category_posts');
function generate_random_category_posts( $query ) {
if ( $query->is_category()) {
$query->set( 'orderby', 'rand' );
}
}It didn't work ...
So I put this in my functions.php
add_action( 'pre_get_posts', 'generate_random_category_posts');
function generate_random_category_posts( $query ) {
if ( $query->is_category(4)) {
$query->set( 'orderby', 'rand' );
}
}And it worked. Plus the blog area remains sorted chronologoically.
Can't work out why it didn't work in category-4.php but at least it's working now ... really need to get my head around all of this but thank you Brad once again
deejukMemberHi Brad thanks again .. sorry I'm no good at code. I'll leave it thanks for your pointers
deejukMemberHi Brad thanks for that but how do I write it into the function for the category template
deejukMemberHi just had a quick look and it looks like most of the content on this page is in a table. The table doesn't have the correct media queries in it to change size.
The quickest solutions it to take the content out of the table and then it should become responsive for you.
deejukMemberThank you for that. I have had a play with it and can't get it to work in the category temp, but it works in functions.php - so all I suppose I will leave it until I have more time to learn some more.
Thank you all for the replies.
deejukMemberWhat I mean is when the above code is functions.php it limits the number of shown in cat 604
However if I place the same code in the cat 604 template file and remove is from the functions.php the post limit goes back to default post count.
deejukMemberHi all thanks for the replies.
I tried adding the same bit of code into my cat template but it doesn't work, although it works in the functions.php file
deejukMemberHi yeh it requires the code to go into functions.php I am looking for the code to site my my category-xx.php file
deejukMemberHi Anita,
I am using a basic child theme which is ref the standard genesis theme
deejukMemberThat kind of works better thank you Brad. I have the following code.
//* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { $post_meta = '[post_terms taxonomy="mytaxonomy"] [post_categories] [post_tags]'; return $post_meta; }
This works fine for normal posts, but for custom post types I get left with an additional Filed Under: where the normal category should be. As it's not linked to normal categories it hasn't got one so obviously can't show it.
This is what I see when I view the custom post type archive
Filed Under: My custom taxonomy
Filed Under:
Tags: my post tagsThis is what I see when I view the normal post archive
Filed Under: A regular category
Tags: My post tags.Any help on this would be great .. even though it takes me a while to work out the pointers but thank you very much
deejukMemberThank you for the info. So added the following and it worked great for custom post types. It shows the CPT taxonomy under filed under, however the Category Taxonomy for regular posts is missing.
//* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { $post_meta = '[post_terms taxonomy="mytaxonomy"], [post_tags]'; return $post_meta; }
deejukMemberHi thanks for that ... where do I past the shortcode in functions.php or my a template file?
deejukMemberThank you for the feed back .. I will ask about around the ACF website.
deejukMemberI haven't to be honest but they do have examples but they are for regular wordpress and don't seem to work in genesis. I was hoping someone here had had some experience.
deejukMemberJust checked that if I use this it works as well a bit simpler. But the map outputs the words Array
echo '<div class="detailbox">'.'<p>';
echo get_field('address').'</br>';
echo get_field('town_or_city').'</br>';
echo get_field('map').'</br>';
echo '</p>'.'</div>';If any one knows how to do this I would be really grateful.
deejukMemberThanks Kellylise, I will take a look at these ... be interesting to here other thoughts on this
deejukMemberHi there. I am more of designer than a coder and use Genesis all the time, I started off using Dynamik and dropped it after a little while.
It is a good system got a few quirks and you can mix and match CSS. I think the only reason I dropped Dynamik and started doing some code and css in just Genesis was speed, because Dynamik runs on the browser and I can't ever be bothered to set a local host I foudn it much easier to Firebug everthing and use a standard CSS editor or Text editor.
All in all I think it's a great starting point if you want to use Genesis, you are almost certainly guaranteed a result. One thing I would add is when it comes to post types and the such like with conditions etc it can be as confusing in some ways to doing it all in code, all that said I am visual person and struggle with code stuff anyway.
deejukMemberThank you for the reply .. it does work thank you.
Shame it simply won't pick up the category styling but hey
deejukMemberFor the record on this I am using Cobolt Dynamik to achieve this. You can set a label in Dynamik and then add CSS directly in a CSS hook. When you edit the post you can then select the label with the styling on and it applies it to just that post.
It seems single posts don't inherit the category styling for some reason, but this is a decent work around if you either have Dynamik or know conditional hooks etc.
-
AuthorPosts