Jump to content


Photo
- - - - -
Resolved

PLOption not being applied when chosen from within page

ploption custom section

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

#1 AngelosTzelepis

AngelosTzelepis

    Member

  • Members
  • 11 posts

Posted 03 October 2012 - 02:58 PM

I have created a custom section, which uses wp_query to pull out posts of a particular category only. The section is intended to be used on custom page templates. I have created an option for this, so that the user can choose the category of posts that should be displayed. The option is a simple dropdown containing the list of categories.

When I select a category from site wide options, it all works fine - only the posts in the chosen category are displayed. But when I select a category from the page options, it isn't applied. Here is my code:

Setting up the option in my section .php file:

Please Login or Register to see this Hidden Content



Pulling out the option:

Please Login or Register to see this Hidden Content



I had a look at the developer docs but the options section doesn't seem to be populated. Any help on how I can apply the option when selected from the page would be much appreciated.

Many Thanks,

John

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 03 October 2012 - 10:03 PM

Can you paste the full code here?

Please Login or Register to see this Hidden Content



#3 AngelosTzelepis

AngelosTzelepis

    Member

  • Members
  • 11 posts

Posted 03 October 2012 - 11:10 PM

Hi Rob,

Thanks for getting back to me. I've pasted the following:

section.php
AAMHCPostsCategory (a supporting class, which extends pagelinesposts)
functions.php

Let me know if you need anything else.

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 04 October 2012 - 10:19 PM

Well, we need the links to what you posted. There are tens of thousands of postings in the pastebin.

Sorry, I should have explained that.

#5 AngelosTzelepis

AngelosTzelepis

    Member

  • Members
  • 11 posts

Posted 05 October 2012 - 12:34 PM

Sorry about that, here are the links:

Please Login or Register to see this Hidden Content


Please Login or Register to see this Hidden Content


Please Login or Register to see this Hidden Content



#6 AngelosTzelepis

AngelosTzelepis

    Member

  • Members
  • 11 posts

Posted 08 October 2012 - 07:42 PM

I have sussed this one out. I replaced $this->oset with an array and populated the items individually. Here is the old code:

Please Login or Register to see this Hidden Content


I replaced it with the following:

Please Login or Register to see this Hidden Content



#7 mackenzie

mackenzie

    Advocate

  • Members
  • 333 posts

Posted 09 October 2012 - 12:11 AM

Is this resolved? I couldn't tell from your last comments.

#8 AngelosTzelepis

AngelosTzelepis

    Member

  • Members
  • 11 posts

Posted 09 October 2012 - 01:17 PM

Yes, it's working now. Thanks.

#9 mackenzie

mackenzie

    Advocate

  • Members
  • 333 posts

Posted 10 October 2012 - 01:04 AM

The topic was marked as resolved.