problem to delete page

This is attachment, you can find it in the Dashboard > Media menu. which id is: 497, you can find it and delete it. As I can see in Inspect element this is image: http://capptan.com.br/blog/wp-content/uploads/2018/07/engajar-e-reter-usu%C3%A1rios-de-aplicativos.jpg But in your template, I can see you have hidden these things via CSS. Hope you know how to delete … Read more

Can’t publish, edit or delete posts since Gutenberg update

This is most likely a plugin or theme conflict in one way or another. Here’s the steps I’ve taken when troubleshooting Gutenberg-related issues: In a staging environment, deactivate all plugins — posting should work as intended now. If it doesn’t then the issue is more likely a theme conflict. 1.a. If it’s a theme conflict, … Read more

How do I programmatically add an image to a post?

Hey I used this code for something similar(I was also downloading remote image and uploading to WordPress site). Please have a look: $image_url = $value;//This is the sanitized image url. $image = pathinfo($image_url);//Extracting information into array. $image_name = $image[‘basename’]; $upload_dir = wp_upload_dir(); $image_data = file_get_contents($image_url); $unique_file_name = wp_unique_filename($upload_dir[‘path’], $image_name); $filename = basename($unique_file_name); $postarr = array( … Read more

Embed WordPress Admin in an iframe

By default WordPress doesn’t allow to embed the admin pages into a frame. From wp-includes/default-filters.php: add_action( ‘admin_init’, ‘send_frame_options_header’, 10, 0 ); To enable embedding, remove the action in a plugin: remove_action( ‘admin_init’, ‘send_frame_options_header’ ); Be aware of the security implications. I wouldn’t do that.

Remove hyperlink to edit post in edit.php

You can remove the a tag with javascript, short and easy. Use the follow plugin; include a small script in the footer of the edit.php, only this page in backend of WP and remove all a-tag inside the table; see the selector on the source below. <?php /** * Plugin Name: Remove a * Version: … Read more

How to hide a post from ‘Recent Posts’ widget?

You can exclude posts from the recent posts widget via the widget_posts_args filter: add_filter( ‘widget_posts_args’, ‘exclude_posts_wpse_103570’); function exclude_posts_wpse_103570( $args ){ // post ID’s to exclude: $args[‘post__not_in’] = array( 123, 234, 345 ); return $args; }

get post id in while loops outputting page id

Dont use query_posts or WP_Query if you need it in the main loop. Dont ever use query_posts anyway. <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <?php $current_id = get_the_ID(); ?> <?php echo $current_id ?> <h1><?php the_field(‘titleFart’, $current_id); ?></h1> <?php endwhile; // end of the loop. ?> <?php endif; ?> … Read more

Undelete post (untrash)?

There is not wp_undelete_post but you have other choices: wp_untrash_post(): when post is trashed, the previous status is stored in _wp_trash_meta_status meta field. wp_untrash_post() restore trashed posts to previous status whatever it was; for example, private, inherit, publish. I’ve not tested it but it should work with a custom post status as well. wp_publish_post(): if … Read more