danhodkinson
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Custom Category ConfusionThe only trouble with that is I have about 20 different categories and so i wanted to avoid code that pointed to categories incase i add more and then i need to add more code.
Dan
Forum: Fixing WordPress
In reply to: Loading in Posts & Custom Posts and then displaying themOk so i kind of having it working using this code:
<?php //first query $favourite = get_posts(array( 'post_type' => 'favourite', 'post_status' => 'publish' )); //second query $portfolio = get_posts(array( 'post_type' => 'portfolio', 'post_status' => 'publish', 'posts_per_page' => 3 )); $mergedposts = array_merge( $favourite, $portfolio ); //combine queries foreach( $mergedposts as $post ) { query_posts( $post ); the_title();?> <br/> <?php } ?>
the only thing i can’t figure out is how to display the $mergedposts randomly?
i tried making a new array for it but that didn’t work? Can’t think what else to do?
Thanks for any help
Dan
Forum: Fixing WordPress
In reply to: Loading in Posts & Custom Posts and then displaying themSorry i don’t really follow you.
in non-code terms i am trying to do the following:
loop = posts x10 , portfolio x4 , photos x5, links x5
show loop (random order)
{
if portfolio{ do x}
else if photos {do y}
etc
}so i dont know if i am able to load in this kind of thing:
<?php $loop = new WP_Query( array( 'post_type' => 'portfolio', 'posts_per_page' => 2, 'order' => 'ASC') ); ?>
into one big loop which outputs everything in a random order.
Dan
Forum: Fixing WordPress
In reply to: Loading in Posts & Custom Posts and then displaying themI’ve looked around but not really been able to find anything. Basically I am going to load in x amount of posts and the x amount of a few different custom posts. Is it possible to set up these different amounts in an array?
Thanks
DanForum: Fixing WordPress
In reply to: Comment Loop, $i; $i problemAh, I see, here is the pastebin link:
https://pastebin.com/wz14KKcnthanks
DanForum: Fixing WordPress
In reply to: Insert tag automaticallyHi Marventus,
I read the whole of the codex entry but couldn’t see a single piece about automatically entering the more tag after x amount of words or after the x paragraph?
Am i being a bit blind?
Dan