No products in the cart.
Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
- AuthorPosts
-
james
ParticipantYou don’t seem to have code that changes
themeToggleLight.style.visibility
. Does this help?if (themeToggleLight.style.visibility == "hidden") { themeToggleLight.style.visibility = "visible"; themeToggleDark.style.visibility = "hidden"; } else { themeToggleLight.style.visibility = "hidden"; themeToggleDark.style.visibility = "visible"; }
james
ParticipantYou can get the current page, post, or custom post type with the global variable
$post
:echo $post->post_title
Note: In a function or class you’ll need to specify
global $post;
prior to trying to use$post
.If you have loops on your page, make sure you end each loop with
wp_reset_postdata();
to set$post
back to the default item being displayed (the page).Note, the ‘post_title’ variable is also available for any custom loop / query… including menu items and media attachments… everything in WordPress is a ‘post’.
- AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)