get_the_ID()
-
Hi,
I am working on some pages and I need to match the ID of the page to display some stuff. Maybe I am overcomplicating things but right now the code that I have does not work.
//Keys if (get_the_ID() == 45424){ echo do_shortcode('[product_categories ids="2063, 2066, 2070, 2097, 2098, 2099"]'); } //Gitaar if (get_the_ID() == 45263){ echo do_shortcode('[product_categories orderby="include" ids="2105, 2106, 2107, 2108, 2109, 2111, 2112, 2113, 2114, 2115, 2116"]'); } //Pro Audio if (get_the_ID() == 45426){ echo do_shortcode('[product_categories orderby="include" ids="1960, 1568, 1973, 1984, 1988, 1990"]'); } //Studio & Recording if (get_the_ID() == 45428){ echo do_shortcode('[product_categories orderby="include" ids="1540, 1594, 1601, 1695, 1716, 1727"]'); } //Accessoires if (get_the_ID() == 45430){ echo do_shortcode('[product_categories orderby="include" ids="1532, 1534"]'); } //Bekabeling if (get_the_ID() == 45432){ echo do_shortcode('[product_categories orderby="include" ids="1523, 1524, 3631, 4350, 1525, 1526, 1527, 3964"]'); } //Case's & Koffers if (get_the_ID() == 45434){ echo do_shortcode('[product_categories orderby="include" ids="1519, 1521"]'); } //Rigging & Stands if (get_the_ID() == 45436){ echo do_shortcode('[product_categories orderby="include" ids="4322, 3653"]'); } //Licht & Effecten if (get_the_ID() == 45438){ echo do_shortcode('[product_categories orderby="include" ids="1508, 4321, 1510, 1511, 1512, 1513"]'); } //Drums if (get_the_ID() == 45440){ echo do_shortcode('[product_categories orderby="include" ids="1503, 1505, 1506, 4099"]'); } //Overige Snaarinstrumenten if (get_the_ID() == 45442){ echo do_shortcode('[product_categories orderby="include" ids="1500, 1501, 2110, 2115"]'); }
Only the ‘Gitaar’ section is displaying correctly, all the others are not showing anything. I triple checked the numbers to see if the ID’s are correct but they are. Does anyone know why I am not seeing a thing?
Also tried to add an else to display an error code but it did not came trough.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘get_the_ID()’ is closed to new replies.