Where is archive.php ? -> ContinuedCustom Post Type
Posted 15 September 2012 - 05:26 PM
( Thanks Simon for answering that here )
This is pretty neat.
However, I now need to add some custom code to it. Meaning perform some initializations etc.
I am a beginner in wordpress and my assumption is that if this were usual word-press, I could have added this initialization code in single.php
Is there some place I can do this in pagelines?
I want to write a select query before the_post()
populate some global variables
and in the actual custom post I want to use these variable values to generate post content dynamically.
but currently in single.php ,I simply see a statement
Posted 15 September 2012 - 10:15 PM
That said, some code may be added to your site in various sections or in particular areas of the page using hooks or other means.
What's the code you're trying to add? Can you paste it here? Also, show us where the results are supposed to go with a mocked up screenshot. Thanks so much for your understanding and cooperation.
Posted 16 September 2012 - 02:23 AM
So Here is what I have done and it seems to be working fine.
I have added some php code (Select query) in my post.
I set some global variables from the query.
and then access these variables in the Boxes below in the page.
This way I have dynamic text in a number of boxes below based on the post.
I can also re-arrange these boxes with drag and drop without fear of loosing the data.
It appears to perform and do just what I wanted.
Please let me know if this method has any down-sides ?
Meaning when I take the site live, will a number of people accessing mix up the global variables ?
Posted 16 September 2012 - 09:33 PM