Title: Derrtass's Replies | WordPress.org

---

# Derrtass

  [  ](https://wordpress.org/support/users/derrtass/)

 *   [Profile](https://wordpress.org/support/users/derrtass/)
 *   [Topics Started](https://wordpress.org/support/users/derrtass/topics/)
 *   [Replies Created](https://wordpress.org/support/users/derrtass/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/derrtass/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/derrtass/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/derrtass/engagements/)
 *   [Favorites](https://wordpress.org/support/users/derrtass/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Google for WooCommerce] Uploading products page goes blank](https://wordpress.org/support/topic/uploading-products-page-goes-blank/)
 *  Thread Starter [Derrtass](https://wordpress.org/support/users/derrtass/)
 * (@derrtass)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/uploading-products-page-goes-blank/#post-15938608)
 * Problem solved, it was caused by “Cost & Reports for WooCommerce” plugin “By 
   Consortia”.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Display post on page with this same name as page name](https://wordpress.org/support/topic/display-post-on-page-with-this-same-name-as-page-name/)
 *  Thread Starter [Derrtass](https://wordpress.org/support/users/derrtass/)
 * (@derrtass)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/display-post-on-page-with-this-same-name-as-page-name/#post-3178861)
 * Hey Mate it works just fine 🙂
    You have made my day thanks a lot!!!
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Display post on page with this same name as page name](https://wordpress.org/support/topic/display-post-on-page-with-this-same-name-as-page-name/)
 *  Thread Starter [Derrtass](https://wordpress.org/support/users/derrtass/)
 * (@derrtass)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/display-post-on-page-with-this-same-name-as-page-name/#post-3178850)
 * Hi
 * Thanks for your reply this exactly what i want… however the code you have sent
   isn’t working..
 * I have uploaded this to functions.php
 *     ```
       /* Hook our querying function into WordPress. */
       	add_action( 'pre_get_posts', 'derrtass_pre_get_posts' );
   
       	function derrtass_pre_get_posts( $query ) {
           global $post;
           $page_slug = $post->post_name;
   
           // Get a post with the same slug as this page
           if ( $query->is_page( $page_name ) ) {
               $query->set( 'name', $page_name );
               $query->set( 'posts_per_page', 1 );
           }
       }
       ```
   
 * And used loop in template to display post….
 * It’s not working I’m afraid

Viewing 3 replies - 1 through 3 (of 3 total)