Jump to content


Photo
- - - - -

Where is archive.php ? -> Continued

Custom Post Type

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 linkinp

linkinp

    Member

  • Members
  • 26 posts

Posted 15 September 2012 - 05:26 PM

Ok I understand now that when you create a custom post type, pagelines automatically creates a template for it, which can be further customized via drag and drop.

( Thanks Simon for answering that here

Please Login or Register to see this Hidden Content

)


This is pretty neat. B)
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 :ph34r:

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
setup_pagelines_template();

Please advice.
----------------

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 15 September 2012 - 10:15 PM

We should start with a basic premise that PageLines is a Framework and not a theme, thus it doesn't use the typical files common to themes such as archive.php and single.php.

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.

#3 linkinp

linkinp

    Member

  • Members
  • 26 posts

Posted 16 September 2012 - 02:23 AM

I pondered on what you have suggested and it has clarified some more.

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.

Please Login or Register to see this Hidden Content


I set some global variables from the query.

Please Login or Register to see this Hidden Content

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.

SUPER NEAT :lol:

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 ?

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 16 September 2012 - 09:33 PM

While you have the site local, test it on all possible browsers. The only downside is going to be how browsers handle it. That's something we can't tell from here.