Slug is changing when I use WP_Query in a metabox of a post

I think that I already found the problem. From wordpress get_posts documentation the have an example of get_post <ul> <?php global $post; $args = array( ‘posts_per_page’ => 5, ‘offset’=> 1, ‘category’ => 1 ); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/273344/<?php the_permalink(); ?>”><?php … Read more

How save custom meta type posts multicheck grouped by taxonomy (with CMB2) [closed]

The same way you would in any other HTML form <input type=”text” name=”name[]” /> <input type=”text” name=”email[]” /> <input type=”text” name=”name[]” /> <input type=”text” name=”email[]” /> <input type=”text” name=”name[]” /> <input type=”text” name=”email[]” /> The above will give you arrays instead of singular values in PHP, so $_POST[‘name’] is an array of 3 values. The … Read more

I need show posts by customer (Shortcode)

First get all data using $all_posts = get_posts( array( ‘meta_key’ => ‘user_name_key’ ,’meta_value’=>’your selected name from widget’) ); foreach($all_posts as $post ){ //add data whatever you want to display on website widget }

Add_Meta_box to custom page (formidable edit post)

Like this? <?php /* Plugin Name: Your plugin name Plugin URI: http://www.domain.com Description: Description Author: You obviously Version: 1.0 */ /** * Adds a meta box to the post editing screen */ include(‘meta_box/meta_box.php’); ?> meta_box.php <?php $post_id = $_GET[‘post’] ? $_GET[‘post’] : $_POST[‘post_ID’] ; $page_temp = get_page_template_slug( $post_id ); if ($page_temp == ‘template_name.php’) { function … Read more

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