As the title suggests, I am trying to apply the values from different custom fields to the posts classes depending on wether the post is viewed in the index page or permalink page. I am not a coder, so I have limited understanding of what I should be doing.
I am aware of the following functions
( get_option('permalink_structure') ) & (get_permalink) & (get_the_permalink)
but I am unsure on where to go next with these? At the moment my content.pho has the following code in it
<article id="post-<?php the_ID(); ?>" <?php post_class(get_field('custom_field_X')); ?>
Which alters the style of the post when seen in the index page to a style dependant on the value inside custom_field_x.
What I need to happen is -
a> for that style to only apply if the post is viewed in the index page,
b> and to stop applying when vieiwng the post as a permalink, and for a different value, say from custom_field_Y, to apply instead
c> this permalink custom field, custom_field_Y, also needs to only apply when in a permalink page and stop applying if in index or any other page.
I guess I would like the code to check for index or permalink first and then apply the values of the appropriate custom field following the succesful fulfilment of a check, or otherwise not apply anything.
the goal is to have a particular style for the individual post in the index page (which has been achieved), and then to have a particular style of the same post when viewed in permalink page (currently stuck on).