Articles of posts

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 […]

Can't update WordPress Page if post_content is Empty

I’m having an issue with WordPress where the Page isn’t Updating if the Visual Editor is Empty. Here are the steps I am taking: Go to Pages Click on an existing page to Edit On the Edit Page screen, Remove all the text from the Visual Editor so that the Visual Editor is blank Click […]

How to limit author related post listing ?

The solution <?php query_posts(‘posts_per_page=9’); ?> to limit author related posts show the entire website post 🙁 <?php $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); ?> <h2>About: <?php echo $curauth->nickname; ?></h2> <dl> <dt>Website</dt> <dd><a href=”<?php echo $curauth->user_url; ?>”><?php echo $curauth->user_url; ?></a></dd> <dt>Profile</dt> <dd> <?php echo $curauth->user_description; ?> </dd> </dl> <h2>Posts by <?php echo $curauth->nickname; ?>:</h2> […]

Problem ordering posts with numbers for titles numerically E.g. 1, 10, 100

I have posts that are named from 1 to 25. But, the WordPress ordering system doesn’t work correctly. It orders them as 1,10,11,12,13…2,21,22,23,24,25. I don’t want to add 0 to 1-9 numbers. How can I fix this issue? I opened same question for categories but I have same problem with posts. My previous question is […]

Restrict displaying posts to the poster itself (in Back-end)

How can I filter posts in the Back-end so that logged in user sees only her/his own postings and not from others on the listings. My CPT declaration: $args = array( ‘labels’ => $labels, ‘description’ => ‘Test plugin.’, ‘public’ => true, ‘menu_position’ => 10, ‘supports’ => array(‘title’, ‘excerpt’, ‘comments’, ‘author’), ‘has_archive’ => false, ‘menu_icon’ => […]

Proper way of establishing custom landing pages in WordPress

Within WordPress 4.6.1, with the TwentySixteen theme, I have 2 general questions in regards to establishing a landing page. From within my child theme folder, where and how do we create a new page to be the new landing page of our site? This page will have a custom coded look and feel. Where in […]

Un-highlight Blog Menu Item when Category Menu Item is Selected

On a site I’m working on, I am using a blog category called ‘Podcast’ for any podcasts that are posted. I have this as a menu item as pictured. My only issue is, that when I click podcast (just a link to /blog/category/podcast/ it highlights both the Blog and Podcast menu items (pictured above), which […]