Need help styling posts with PHP
-
This is rather a basic question. Generally I work in HTML,CSS & Javascript but I do have basic knowledge in PHP.
I need to have multiple “recommended” posts appear above the regular posts in a category. I checked various plugins, using sticky – nothing worked properly.
So… I am creating “recommended” categories so these posts will have their own unique category and I used the following code, found in WordPress Codex, to implement them in the category template:
<?php $args = array ( 'category' => ID, 'posts_per_page' => 10); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> //Style Posts here <?php endforeach; ?>I, of course, replace ID with the new category ID I am creating.
In this case I am using the Business Services category page and created a Recommended Business Services.
Now I need to be know where to find the styling of posts to place in //Style Posts here or a I presume that is what is needed to display the posts in the same exact style as the posts I already have. If you look at my link you will see the area where the posts are just say “//Style Posts here” of course. I am trying to find the easiest way to do this – could someone please help! I know with time I will figure this out – but I could mess things up! A basic example that I can tinker with is what I am hoping to see. I know this is simple – I am just having a bad day.
The page I need help with: [log in to see the link]
The topic ‘Need help styling posts with PHP’ is closed to new replies.