Title: peggysdev's Replies | WordPress.org

---

# peggysdev

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[OceanWP] Single Page for CPT named Products does not display correctly](https://wordpress.org/support/topic/single-page-for-cpt-named-products-does-not-display-correctly/)
 *  Thread Starter [peggysdev](https://wordpress.org/support/users/peggysdev/)
 * (@peggysdev)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/single-page-for-cpt-named-products-does-not-display-correctly/#post-12491604)
 * Hello Amit,
 * I am new to WordPress and evaluating it locally to check suitability for a new
   project, so unfortunately I don’t have a public page to link to.
 * If the CPT slug is changed then the Single page is rendered correctly, as expected,
   because the code shown above is not called.
 * However, if the slug remains as ‘product’, as one might reasonably expect it 
   to be, then the code above raises an exception and the Single page fails to render
   correctly.
 * > Exception has occurred.
   >  Fatal error: Uncaught Error: Call to undefined function
   > wc_get_page_id() in /htdocs/wp-content/themes/oceanwp/inc/breadcrumbs.php:655
   > Stack trace: #0 /htdocs/wp-content/themes/oceanwp/inc/breadcrumbs.php(402):
   > OceanWP_Breadcrumb_Trail->add_singular_items() #1 /htdocs/wp-content/themes/
   > oceanwp/inc/breadcrumbs.php(205): OceanWP_Breadcrumb_Trail->add_items() #2 /
   > htdocs/wp-content/themes/oceanwp/inc/breadcrumbs.php(65): OceanWP_Breadcrumb_Trail-
   > >__construct(Array) #3 /htdocs/wp-content/themes/oceanwp/partials/page-header.
   > php(62): oceanwp_breadcrumb_trail() #4 /htdocs/wp-includes/template.php(724):
   > require(‘…’)
 * Other themes, such as GeneratePress and twentytwenty handle a CPT with a slug‘
   product’ correctly.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[OceanWP] Single Page for CPT named Products does not display correctly](https://wordpress.org/support/topic/single-page-for-cpt-named-products-does-not-display-correctly/)
 *  Thread Starter [peggysdev](https://wordpress.org/support/users/peggysdev/)
 * (@peggysdev)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/single-page-for-cpt-named-products-does-not-display-correctly/#post-12488582)
 * Lines 650-659
 *     ```
       		// If the post type is 'product'.
       		else if ( 'product' === $post->post_type
       			&& 'none' != $products_tax ) {
   
       			if ( 'shop' == $products_tax ) {
       				$shop_id = wc_get_page_id( 'shop' );
       				$this->items[] = sprintf( '<a href="%s">%s</a>', esc_url( get_permalink( $shop_id ) ), get_the_title( $shop_id ) );
       			} else {
       				$this->add_post_terms( $post_id, $products_tax );
       			}
   
       		}
       ```
   

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