Jump to content


Photo
- - - - -

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


  • Please log in to reply
17 replies to this topic

#1 dharmagate

dharmagate

    Advanced Member

  • Members
  • 65 posts
  • Framework Version:2.3.1
  • Country: Country Flag

Posted 26 April 2011 - 08:28 PM

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

#2 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 27 April 2011 - 12:17 AM

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

#3 dharmagate

dharmagate

    Advanced Member

  • Members
  • 65 posts
  • Framework Version:2.3.1
  • Country: Country Flag

Posted 28 April 2011 - 10:05 PM

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

#4 pbakker22

pbakker22

    Member

  • Members
  • PipPip
  • 23 posts

Posted 29 April 2011 - 03:16 PM

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?

#5 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 29 April 2011 - 04:26 PM

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

#6 pbakker22

pbakker22

    Member

  • Members
  • PipPip
  • 23 posts

Posted 29 April 2011 - 05:19 PM

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

#7 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 29 April 2011 - 09:36 PM

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

#8 pbakker22

pbakker22

    Member

  • Members
  • PipPip
  • 23 posts

Posted 30 April 2011 - 03:24 AM

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..

#9 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 30 April 2011 - 07:14 PM

Can you paste in your entire functions.php?

#10 pbakker22

pbakker22

    Member

  • Members
  • PipPip
  • 23 posts

Posted 30 April 2011 - 10:01 PM

Sure: ` 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 ?> 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(){?>

#11 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 30 April 2011 - 11:13 PM

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

#12 pbakker22

pbakker22

    Member

  • Members
  • PipPip
  • 23 posts

Posted 30 April 2011 - 11:38 PM

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?

#13 kastelic

kastelic

    Advocate

  • Members

  • 3081 posts
  • Country: Country Flag

Posted 30 April 2011 - 11:56 PM

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.)

#14 pbakker22

pbakker22

    Member

  • Members
  • PipPip
  • 23 posts

Posted 01 May 2011 - 12:04 AM

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!