Show post content in two different places without redirect

I ended going the CPT route, as I couldn’t figure out other way. Just added a bunch of logic to duplicate/modify/delete the normal posts when needed. <?php // function for the CPT function SU_kuuma_kysymys_type() { // creating (registering) the custom type register_post_type( ‘kuuma_kysymys’, /* (http://codex.wordpress.org/Function_Reference/register_post_type) */ // let’s now add all the options for this … Read more

How to add custom column to Custom post page list?

There is the hook manage_${post_type}_posts_columns which can be used to do just that. Basic example: function wpse188743_events_cpt_columns( $columns ) { $new_columns = array( ‘event_date’ => __( ‘Event Date’, ‘textdomain’ ), ); return array_merge( $columns, $new_columns ); } add_filter( ‘manage_events_posts_columns’ , ‘wpse188743_events_cpt_columns’ ); To fill the column with the related content you additionally have to make … Read more

Different post into a single page

Add the below code in your single.php file <div class=”post-contents”> <?php $args = array( ‘posts_per_page’ => -1,’orderby’=> ‘date’,’order’=> ‘DESC’,’post_type’ => ‘post’,’post_status’=> ‘publish’); $myposts = get_posts( $args ); foreach ( $myposts as $post ) : setup_postdata( $post ); ?> <div class=”post-single”> <a href=”https://wordpress.stackexchange.com/questions/193620/<?php the_permalink(); ?>”><?php the_title(); ?></a> <p><?php echo $post->post_content; ?></p> </div> <?php endforeach; wp_reset_postdata();?> </div>

Modifying a local template

Depends on the type of template you wish to change. Generally templates have a suffix to them. Some examples: Page Suffix These are used for templates on either individual pages or specific theme templates. page.php page-products.php page-cars.php Single Suffix Used for custom post types or just individual post types. The type of post type defined … Read more

Query multiple post of which one by taxonomy

I solved my problem by automatically adding the tag ‘light’ to all my projects. And then query all the post and projects with the light tag like this: Query post by taxonomy tag ‘light’: $args = array( ‘post_type’ => array( ‘projects’ , ‘post’ ), ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘post_tag’, ‘field’ … Read more

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