Articles of posts

Post Title to featured Image ALT

i saw a interesting post on Stackoverflow where someone showed a code to to use the post title als alt tag for the featured post. So i tried to use the code for myself and change it a bit because mine differs a bit. Original Code $title=get_the_title(); the_post_thumbnail( array(150, 150),array( ‘alt’ =>$title) ); I changed […]

How to display the requested post only?

I have created a custom theme and my front page is index.php. Moreover, I have couple of blog posts and I display them with a loop in this page, together with a link for each particular post. The problem is that whenever I click on this link, the browser loads the correct permalink, e.g. http://localhost/wordpress/index.php/2016/04/20/title-of-clicked-post/, […]

Display value of custom field at the beginning of a post

I’ve been using the subtitles plugin to display a teaser text to my posts right underneath the title (which is named _subtitle, and stored in the post’s meta). How do I display this value at the post_content‘s beginning?

how to get posts ids inside pre_get_posts filter?

I’m trying to do these one: On the home (front page) i have multiple posts loops. I need posts to not repeat across these loops ( i.e if post was shown in 1-st loop it should never appear in 2-nd or 3-rd and so on ). I’v come up with these ( lower ), but […]

How to Submit Post Via cURL & PHP

Thanks for reading. I’m trying to submit a post via PHP. I’m filling in a large number of posts from a good amount of data I’ve scraped so I need this to be automated. I don’t have the time (or desire) to manually input 700+ posts. I am versatile with programming, but newer to WordPress […]

Sticky Post from page 2 and on

Today I updated an old blog post and set it to sticky to show info about the latest changes. It’s a typical post with Site Updates as the title for a log of a sort you could say, with past changes listed by date. What I discovered was if the post originates from page two […]

Posts are not rendering perfectly

In my custom WordPress theme posts are not rendering perfectly. Maybe there is css issue, but I am not able to figure out. I have added code of my index.php. Please have a look. <?php get_header(); ?> <div id=”primaryContent” class=”content-area”> <main id=”main” class=”container site-main” role=”main”> <?php if(have_posts()) : while (have_posts()) : the_post(); ?> <div class=”post_box”> […]

Do one have to wait after pressing “update” on a post edit page?

Do one have to wait after pressing “update” on a post edit page (becuase if he won’t the post update process will be ruin) or does it make no difference what happens after one clicked the button?

Removing all post tags except a given list

Got a request from a client to remove all post tags except the ones in a file they provided me. Been trying to figure out how to do it with wp term, but don’t see a way to work from a file.. My best guess would be something like: wp term list post_tag –field=name | […]

How to filter url on post submission?

I would like to swap out image URLs upon post submission on both content editor field and a custom field cover_image of a custom post type article. For example, the original content may contain image url such as: <img src=”http://img.mywordpresstips.com/custom-post-types/filename.jpg”> I would like to swap it to: <img src=”http://img.mywordpresstips.com/custom-post-types/filename.jpg”> And have it stored permanently to […]