Hot answers tagged

1

Suppose you haven't modified anything to change the default content output, maybe this can help: add_filter('the_content', function($content) { $content = preg_replace('~^<p><img([^>]+)></p>~i', '', $content, 1); return $content; }, PHP_INT_MAX);


1

The below code check that post have category or not. If post have category then it will display list of category separate by comma. You can try this code. Hope this will help you. if(has_category()) { echo $cats_list = get_the_category_list(', '); }


1

In general the answer is yes and the web is full of good tutorials that would do a better job than I can here.


1

Sadly the stock wordpress doesn't give much more help with custom fields. I'd recommend using the advanced custom fields plugin. https://wordpress.org/plugins/advanced-custom-fields/ You can set the name when creating a field and match it to what you've been using and it should work retroactively on old posts and content as well.


1

to use a translation not finished yet, click on "Export" here : https://translate.wordpress.org/projects/wp/dev/si/default . And save the files as si.po and si.mo in the directory wp-content/languages (choose the extension in the dropbox menu) If there is word missing, you can use Podedit to edit the file and you can also propose your word in the tool ...


1

Here's a more readable version of the solution provided by Michael <?php $posts = new WP_Query(array('posts_per_page' => -1)); if ($posts->have_posts()): ?> <ul id="archives"> <?php $prev_month = ''; while ($posts->have_posts()): $posts->the_post(); if (get_the_date('F Y') != $prev_month): $...



Only top voted, non community-wiki answers of a minimum length are eligible