Articles of posts

Check if user has avatar

I want to show author avatar in post info. So I use <?php echo get_avatar( get_the_author_meta( ‘ID’ ) , 80); ?> But how can I check if user has avatar?

Loading Posts & Category with Ajax

Is there any way to make this function also output another html template with the current selected category’s data? function load_cat_posts () { $cat_id = absint($_REQUEST[‘cat’]); $args = array ( ‘cat’ => $cat_id, ‘posts_per_page’ => 10, ‘order’ => ‘DESC’ ); global $post; $posts = get_posts($args); ob_start (); foreach ( $posts as $post ) { setup_postdata( […]

how to get options to choose post format in add new post

I’ve created a new post type gallery using CPT UI plugin, Now I want to add options to choose post Format and Featured Image in add new gallery post. Please check the attached screenshot. Could you please tell me how to get this option in add new post page.

Need to change all links in page content but not in post content

So usually I would just do a database search and replace for changing my URL but what I’ve done now is decided to split my site into two different sites which works great for me because of the way I organized content with pages and posts. All the pages have links going to posts on […]

How to add padding between posts

Ultimately, I’m really confused on how exactly you create a single class that affects each post in a static home page “recent post” type content area. I want to essentially have it where there’s a post with a background, a space, then the next post with the same background, but not have the background behind […]

Four posts per row

I want to show as <div class=”team-list-wrapper clearfix wow fadeInUp” data-wow-duration=”1s” data-wow-delay=”0.5s”> <ul id=”co-team”> <li class=”nav team-list”> <li> <li class=”nav team-list”> <li> <li class=”nav team-list”> <li> <li class=”nav team-list”> <li> </ul> <ul id=”co-team”> <li class=”nav team-list”> <li> <li class=”nav team-list”> <li> <li class=”nav team-list”> <li> <li class=”nav team-list”> <li> </ul> </div> And below is the […]

array_rand not working correctly?

I want to show different content on each page refresh. To accomplish this, I’ve used the PHP array_rand() function. I fetched posts and stored content in a value using the below code. When I output the value before array_rand(), it is showing first post content but in array_rand() if I output the random functionality is […]

How to show different timestamp

I would like to show published time “Posted 4:15pm” for the first 24 hours, after 24hours show full published date and time “September 27, 2016 at 4:15pm” Any suggestions? Thanks in advance

Load content in a div with ajax

please give me advice Im very new to ajax, I have a list of posts, if I click it will display the posts information in a div without load the page. I know I must use ajax, so I create a file: loadcontent.php in a root folder and use this code below, but I don’t […]

How to have more than one page for your posts if you have 8 posts but can store max 4 on a page

Hello I am new to wordpress and I am creating a custom template. I am sorry if this is simple and has been asked before. I have 8 posts in a page and I have set the page to display a maximum of 4 posts on this page. So my question is how can I […]