0
votes
0answers
236 views

Why WP_Query in functions.php is not working when get_posts works?

I have following code in my functions.php. When I try to add new post_type (e.g. post,lawyers) it fills excerpt,slug (this affects in permalink structure), other metaboxes from first post of lawyers ...
0
votes
1answer
113 views

custom post type upcoming post and past post

I want to retrieve inside my archive-CPT.php most recent upcoming post ( post with status of future) and past post (oldest published post). This is how my archive-CPT.php is looking like: <?php ...
0
votes
1answer
150 views

Test if a post exists by category and date

I would like to check outside of the loop, if a certain post exists in a specific category and from a specific date. The function get_posts() -- if I get it right -- allows me to check, if there are ...
0
votes
1answer
62 views

Turn get_posts as string into an array for use in theme admin options

I am trying to add a drop down list of all posts into a theme admin section...without forklifting the theme code. I need to pass the post title and id into the 'options'=>array() like so: ...
0
votes
1answer
88 views

Internal linking to posts permalink fail because of spaces and stripe at postname

I have written a function which outputs a tag in a textarea in which people can link internally to other posts on the website. This works like a charm except with using a postname permalink ...
1
vote
1answer
168 views

Logged in user ID as post ID

Is there a way to automatically insert the current user ID as the post category name or maybe have WordPress display only the post with a category name that matches the current logged user ID? ...
0
votes
1answer
888 views

get excerpt without images

Is there any way to not get the images with get_the_excerpt()? I am using a my_recent_post() function to pull posts onto the home page and I don't need to have it pull the images within the posts, ...
0
votes
1answer
835 views

Function to get content by ID

I'm trying to get text only content of posts by ID. I modified this function as follows, but at the moment it returns nothing. I cannot see what's wrong with it. function get_the_excerpt_id($post_id) ...