438 posts
  • Has been part of the Envato Community for over 3 years
  • Sells items exclusively on Envato Market
  • Located in United States
christopherjon says
What about this for keeping all “slides” related stuff under one location, with drag’n’drop sorting?
That’s a great tutorial but if I remember correctly, since it was written for organizing, you don’t have any control over which custom posts are displayed. If the query is set for 5, you’ll always show the top 5.

It’s not really a big deal for most sites.

The work around is to set posts you don’t want to show to draft but that tutorial would certainly get the job done. Would work really well for something like Anything Slider that allows inline content. Probably overkill using custom post types for something like Nivo that in most cases is just going to be a collection of images.

I remember spending a couple of days a long time ago trying to mod that code into a homepage construction panel. It was a fail.

Solution… steal the sortable code from Options Tree :)

2445 posts
  • Has referred 100+ members
  • Has sold $100+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+3 more
digitalimpact says
christopherjon said
That’s a great tutorial but if I remember correctly, since it was written for organizing, you don’t have any control over which custom posts are displayed. If the query is set for 5, you’ll always show the top 5.

Actually, you do. posts_per_page query is set to -1, so all of them display in the admin.

Then, you could define an option that the user sets (like “Show: 5 slides”) have the theme display the first 5 slides in the frontend with a custom query based on that number.

That way, user specifies only 5 slides will show up on the site, while in the backend, he can view and sort all slides. No need for drafts.


<?php /**
 * Display Sort admin
 *
 * @return void
 * @author Soul
 **/
function soulsizzle_sort_videos() {
    $videos = new WP_Query('post_type=video&posts_per_page=-1&orderby=menu_order&order=ASC');
?>
    <div class="wrap">
    <h3>Sort Videos <img src="<?php bloginfo('url'); ?>/wp-admin/images/loading.gif" id="loading-animation" /></h3>
    <ul id="video-list">
    <?php while ( $videos?>have_posts() ) : $videos->the_post(); ?>
        <li id="<?php the_id(); ?>"><?php the_title(); ?></li>            
    <?php endwhile; ?>
    </ul></div><!-- End div#wrap //-->

<?php } ?>

Oh, and let’s not forget that our CodeCanyon friends do cool stuff: check out Reorder ;)

438 posts
  • Has been part of the Envato Community for over 3 years
  • Sells items exclusively on Envato Market
  • Located in United States
christopherjon says
Actually, you do. posts_per_page query is set to -1, so all of them display in the admin.

That’s a cool trick. I never thought about that. Learn something new every day. :)

316 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+2 more
SyamilMJ says
devinsays said
I love seeing how people are using the Options Framework code. Cheers to Syamil for sending this forums thread link over to me.

It looks like Syamil has done a good job customizing the code but I’ve always felt that slider controls weren’t quite the appropriate in a theme options panel. If it has a title, summary and/or image it feels more like content than options.

I know WooThemes uses custom post types for some of their sliders. If people went that route I think a plugin would be great. It could be offered on .org and any theme could be built to be compatible with it. Or it could be offered as a bundled plugin with the theme, so that if your user switches themes they can still have their content available.

Another interesting way to do it might be to adapt the menu functionality. You could have the user build their “menu”, and have one of the registered menus be a slider.

It’s definitely an interesting challenge. Just wanted to offer a few ideas for other routes.

Thanks for joining in Devin, I appreciate it.

I guess the whole idea of having a slider in the options panel is to simplify the process of setting up one. I’ve seen several trends of how people set up their sliders:

1. Custom category/tag (most popular)

2. Custom slider options

3. Dedicated custom post type just for the sliders. ( e.g. Woothemes )

4. Fixed-number, non-sortable slider options using Options Framework or other similar options panel.

I’ve tried all of the said above, and in my opinion, a slider option is the most simplified way of doing it.

I am not saying that one method is better than another. Perhaps each author have different opinions on what will work best for their themes. I just thought it’d be great to offer the slider option built-in inside Options Framework should anyone needs them. :)

1593 posts Chris Robinson
  • Located in United States
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
contempoinc says

Going through the code I noticed your not using the of_get_option function to output the various options added. You have some example code to output the homepage slider options, however I didn’t see anything about outputting the others? Guessing I’m just overlooking something, any help is appreciated.

1593 posts Chris Robinson
  • Located in United States
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
contempoinc says

Nevermind…figured it out.

751 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
CyberShot says

are there any tutorials on how to add options and get the options using this framework?

316 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+2 more
SyamilMJ says

Hey guys.

I will write a tutorial on how to use these options. Seems like there is not enough documentation on the WPTheming itself that explains how to use them.

Also, I have already done several fixes to the codes and added some new features. For example, now we have a drag & drop layout manager :

This new version will be uploaded soon, so stay tuned.

In the meantime, if you need any help feel free to open a ticket on Github or comment on my post about it here. :)

1593 posts Chris Robinson
  • Located in United States
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
contempoinc says

Nice, looking forward to the layout manager update!

316 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Has been part of the Envato Community for over 3 years
+2 more
SyamilMJ says
contempoinc said
Nice, looking forward to the layout manager update!

The latest version on Githbub now have this

Also as a recap:

- Remember last tab on page refresh

- Slider title updates upon typing

- Enable/Disable blocks by drag & drop inside layout manager

- Shaved off most if not all “undefined index” errors.

- Default options save to database upon first time activation/reset

Remember to turn off WP_DEBUG then hit “Reset” for first time activation. You can turn on WP_DEBUG later afterwards.

Still working on:

- XML export/import

- Unlimited sidebar

I’ll be off the grid for a while, so expect the next update to be anywhere between 2-3 weeks time.

Happy theming!

:)

by
by
by
by
by
by