Frontend post creation including image attachment

Well you have not mentioned whether your code worked or not because the blog you are following is amazing one. And you should have get the solution from that post. And regarding your question.. require_once(ABSPATH . ‘wp-admin/includes/image.php’); This is a core WordPress file which does all the manipulation on images and its meta data. Why … Read more

How to update the children of a post?

get_children returns an array of post objects by default: https://developer.wordpress.org/reference/functions/get_children/ So you would have to use ‘ID’ => $child->ID, in this case… also my want to wrap the foreach with if (count($children) > 0) {} to prevent possible errors where there are no children. ie: $children = get_children( $mainid ); if (count($children) > 0) { … Read more

I am trying to add checkbox for anonymous post on form post

First of all don’t ever edit core files. Your changes will be lost on update. WordPress has a great way to expand as needed called Plugin. As you don’t have enough knowledge about how WordPress works I suggest to use this ready made solution to avoid any risk. Here is the link

How to add correct Last update in Postings (the_modified_time)

You could compare post_date to post_modified and only echo your content if they do not match. // inside a Loop if ($post->post_date != $post->post_modified) { ?> <span style=”font-size:85%”>Last update <u><time datetime=”<?php the_modified_time(‘d-m-y’); ?>”> <?php the_modified_time(‘l j F, Y’); ?></time></u></span><?php } If you want “significant” updates, though, you will need to determine what counts as significant … Read more

Posting variables to WP database using $_POST method

Modify your code like this. It should work now. What you did wrong is both $curQuarter & $curYear is php variable not a part POST. you can directly use them. <?php $curMonth = date(“m”, time()); $curQuarter = ceil($curMonth/3); $curQuarter = $curQuarter-1; $curYear = date(‘Y/m/d’, strtotime(‘-14 day’)); $curYear = date(‘Y’, strtotime($curYear)); if (!empty($_POST)) { global $wpdb; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)