Jump to content


Photo
- - - - -

Featured Source = Sticky Post


  • Please log in to reply
8 replies to this topic

#1 diablo943

diablo943

    Newbie

  • Members
  • 7 posts

Posted 19 September 2011 - 04:26 PM

I'd like the ability to set the Featured content by whether a Post (and ideally a post from a Category) is set as Sticky. That way I can feature the latest content easily in a PageLines Featured area without having to duplicate effort by creating an identical Featured custom post. Since we can already link the Featured content to a Post Category, it seems like the framework is already set up to be able to link it to Sticky status. Just not sure if the hooks exist and how to pull it off... Can anyone point me in the right direction? Thanks, Dave

#2 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 19 September 2011 - 04:50 PM

I'm going to mark this for the devs because I'm not sure which function you'll want to filter. But, I think it should be as straightforward as modifying the query_posts() variables. ("query_posts(array('post__in'=>get_option('sticky_posts')));"). You could try using a filter on the pagelines_before_feature() function.

#3 diablo943

diablo943

    Newbie

  • Members
  • 7 posts

Posted 19 September 2011 - 05:22 PM

The primary reason I want to do this is so I can add Featured content to the default page that is Category independent. The motivation comes from the fact that although a Post is in the Exhibit category, to make it show up in the Feature default I have also been adding it to the Featured category. The problem is that when you navigate to the post, the Breadcrumb shows that it is in the Featured category and not the Exhibit category making it confusing. Thanks, Dave

#4 diablo943

diablo943

    Newbie

  • Members
  • 7 posts

Posted 19 September 2011 - 05:37 PM

It looks like I need to add an option to the 'feature_source' array of 'sticky' so it can be selected as the option in the admin. So far my initial attempts here are unsuccessful... Then I need to test if the 'feature_source' is 'sticky' and build the feature content appropriately. Not sure exactly what all this is comprised of... Hmmm... Thanks, Dave

#5 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 19 September 2011 - 05:56 PM

Try something like this:

Please Login or Register to see this Hidden Content

This is around line 315 of section.features.php

UNTESTED ;)

Please Login or Register to see this Hidden Content



#6 diablo943

diablo943

    Newbie

  • Members
  • 7 posts

Posted 19 September 2011 - 06:12 PM

What if I added a test for 'sticky' just below like this... :-?

Please Login or Register to see this Hidden Content


Thanks,
Dave

#7 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 19 September 2011 - 06:16 PM

ok your using elseif so you still need to include the cat

Please Login or Register to see this Hidden Content



#8 diablo943

diablo943

    Newbie

  • Members
  • 7 posts

Posted 19 September 2011 - 06:54 PM

What if I create an array option of 'sticky' with...

Please Login or Register to see this Hidden Content


And then test for 'sticky' and display sticky posts if this is selected in the admin...

Please Login or Register to see this Hidden Content


It isn't working, yet. But this seems like the ability to offer the most flexibility via the admin panel. The pull down doesn't show the Sticky option currently and sticky posts aren't being displayed in the Feature area.

Hmmm...
Dave

#9 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 19 September 2011 - 11:49 PM

marked for pross