Sign in to follow this  
Followers 0

Boxes Widget: Allows you to display your boxes in a widget area

14 posts in this topic

Posted · Report post

Hi there This is a great widget and I find it very useful. In the new versions of platform pro, it is possible to set the box title and image as a link in the box creation page. Box Setup Options: Box Link (Optional) Make the box image and title clickable by adding a link here (optional)... Unfortunately, this widget does not handle this information. Would any one care to look at the code and see if it will be hard to pass the links data to the widget? Regards

Share this post


Link to post
Share on other sites

Posted · Report post

Try referencing the original file and see how it differs in template structure. Scott's is very organized so it shouldn't take much.

Share this post


Link to post
Share on other sites

Posted · Report post

Adam, I have no idea how to do that, does any one care to try?

Share this post


Link to post
Share on other sites

Posted · Report post

This is what I'm looking for. Can't seem to get it to work though: when I insert the code supplied into the base functions.php `require_once(dirname(__FILE__).'/widget.boxes.php');` then it messes up the site and Dashboard. I've copied Scott's widget.boxes.php to the theme folder, but I must be doing something wrong. Can anyone help?

Share this post


Link to post
Share on other sites

Posted · Report post

Where in theme folder did you copy the widget.boxes.php file to?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Catrina, I copied it to the main platform base folder: wp-content/themes/platformbase

Share this post


Link to post
Share on other sites

Posted · Report post

Seems like you included it right. Are you sure the widget.boxes.php code was copied over completely?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Jimmy, I put that exact code I quoted above into the base functions.php; what happens is that I only see code on the screen after it takes effect..

Share this post


Link to post
Share on other sites

Posted · Report post

Can you paste in your entire functions.php?

Share this post


Link to post
Share on other sites

Posted · Report post

Sure: ` <?php // Setup -- Probably want to keep this stuff... // Set up action for section registration... add_action('pagelines_register_sections', 'base_sections'); /* Hello! First, lets load the PageLines core so we have access to the functions */ if ( file_exists( TEMPLATEPATH . '/core/core.init.php' ) ) require_once(TEMPLATEPATH . '/core/core.init.php'); else add_action( 'template_redirect', create_function( '', 'echo "

Unable to locate the main PlatFormPro theme files! These should be in wp-content/themes/platformpro

";' ) ); // For advanced customization tips & code see advanced file. //--> require_once(STYLESHEETPATH . "/advanced.php"); // ==================================================== // = BASE FUNCTIONS - Where you should add your code = // ==================================================== require_once(dirname(__FILE__).'/widget.boxes.php'); // ADDING CUSTOM SECTIONS ------- // // Register a Drag&Drop HTML Section for the admin. // A pullquote section was created here for demonstration purposes // Sections should be named: section.[your section name].php and placed in the sections folder. function base_sections(){ /* Your custom sections get registered in here... PageLines Register Section Arguments: 1. Section Class Name, 2. Directory name (or filename if in root of 'sections' folder), 3. Init Filename (if different from directory name), 4. Section setup and variable array */ pagelines_register_section('BasePullQuote', 'pullquote', null, array('child' => true) ); pagelines_register_section('BaseSidebar','sb_base', null, array('child' => true) ); pagelines_register_section('ContentBoxes', 'contentboxes', null, array('child' => true) ); } // ABOUT HOOKS --------// // Hooks are a way to easily add custom functions and content to the Platform theme. There are hooks placed strategically throughout the theme // so that you insert code and content with ease. // HOOKS EXAMPLE --------// // Below is an example of how you would add a social media icon to the icons in header (branding section) // We have placed a hook at the end of the icon set specifically add new icons without modifying code or having to worry about your edits // getting thrown out during the upgrade process. The way to use hooks goes a little like this: // add_action('hook_name','function name'); // ---> uncomment to load //add_action('pagelines_branding_icons_end', 'add_icons_to_branding'); // function name function add_icons_to_branding(){ // This hook adds a stumbleupon icon to the header of your theme. The class referenced in the link can be seen in the style.css // and is the image from the CSS is placed in the images folder ?> <?php } // end function // ABOUT FILTERS ----------// // Filters allow data modification on-the-fly. Which means you can change something after it was read and compiled from the database, // but before it is shown to your visitor. Or, you can modify something a visitor sent to your database, before it is actually written there. // FILTERS EXAMPLE ---------// // The following filter will add the font Ubuntu into the font array $thefoundry. // This makes the font available to the framework and the user via the admin panel. add_filter ( 'pagelines_foundry', 'my_google_font' ); function my_google_font( $thefoundry ) { $myfont = array( 'Ubuntu' => array( 'name' => 'Ubuntu', 'family' => '"Ubuntu", arial, serif', 'web_safe' => true, 'google' => true, 'monospace' => false ) ); return array_merge( $thefoundry, $myfont ); } // ADDING NEW TEMPLATES --------// // Want another page template for drag and drop? Easy :) // 1. Add File called page.[page-id].php to Base // 2. Add /* Template Name: Your Page Name */ and Call to 'setup_pagelines_template();' to that file (see page.base.php) // 3. Add 'pagelines_add_page('[page-id]', '[Page Name]');' to this functions.php file // Add Base Page if ( function_exists( 'pagelines_add_page' ) ) pagelines_add_page('base', 'Custom Page'); add_action('wp_footer','new_window'); function new_window(){?> <?php } // OVERRIDE SECTION TEMPLATES --------// // Want more customization control over any of the core section templates in PlatformPro? Just override the template file. // To do that, just add a file called template.[section-id].php to this child theme and it will override the section templates // for the section with that ID. For example, template.boxes.php will override the boxes templates. // Once overridden you can copy the code from that section, paste it there and edit to your heart's content. `

Share this post


Link to post
Share on other sites

Posted · Report post

Don't know if this is the best way but I tried this and it worked:

require_once(TEMPLATEPATH .'/widget-boxes.php');

and put widget-boxes.php in the platformpro directory not platformbase

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Jimmy, I followed your instructions, but I get this error message: ` Warning: require_once(C:xampphtdocsAMH/wp-content/themes/platformpro/widget-boxes.php) [function.require-once]: failed to open stream: No such file or directory in C:xampphtdocsAMHwp-contentthemesplatformbasefunctions.php on line 20 Fatal error: require_once() [function.require]: Failed opening required 'C:xampphtdocsAMH/wp-content/themes/platformpro/widget-boxes.php' (include_path='.;C:xamppphpPEAR') in C:xampphtdocsAMHwp-contentthemesplatformbasefunctions.php on line 20 ` Since I'm running the site locally, could that be why it isn't loading?

Share this post


Link to post
Share on other sites

Posted · Report post

Hmm, I suppose it could be, I'm not really sure. You sure that the file is in pro not base? (the line in functions.php, however, I did put in the base functions.php.)

Share this post


Link to post
Share on other sites

Posted · Report post

Yep, the file is in the Pro folder and the line was added to the base functions.php. I'll play around with it some more; I may have to take the site online to see if that makes a difference, but that'll be in a week or two. If I figure it out I'll let you know. Thanks for your help though!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0