0

i'm having a problem on my wordpress site after editing a php file i start getting this error:

Parse error: syntax error, unexpected 'pf_itemgrid2_func' (T_STRING) in /pf-grid-shortcodes-static.php on line 1

even after undoing the changes and replace the file back to the original i still keep getting that error not sure what happened i even placed the full code inside a php code checker and nothing is showing up. Here are the first lines of code of that php file, thanks upfront for any advice on the subject.

<?php
function pf_itemgrid2_func( $atts ) {
  extract (shortcode_atts(array(
    'listingtype' => '',
    'itemtype' => '',
    'conditions' => '',
    'locationtype' => '',
    'posts_in' => '',
    'sortby' => 'ASC',
    'orderby' => 'title',
    'items' => 8,
    'cols' => 4,
    'features'=>array(),
    'filters' => 'true',
    'itemboxbg' => '',
    'grid_layout_mode' => 'fitRows',
    'featureditems' => '',
    'featureditemshide' => '',
    'authormode' => 0,
    'agentmode' => 0,
    'author' => '',
    'manualargs' => '',
    'hidden_output' => '',
    'ne' => '',
    'ne2' => '',
    'sw' => '',
    'sw2' => '',
    'listingtypefilters' => '',
    'itemtypefilters' => '',
    'locationfilters' => '',
    'tag' => ''
  ), $atts ) );

Here is the link to a pastebin file for the full code:

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
javier
  • 19
  • 4
  • Are you sure this is the right file?! – Rizier123 Apr 22 '16 at 17:25
  • Yes is the right on that is just a portion of the code, weird thing is it was working fine before i edited then why after re-placing it with the original file without my updates is still showing that error? – javier Apr 22 '16 at 17:30
  • @Rizier123 `function pf_itemgrid2_func( $atts ) {` no closing `}`. So, if the OP edits with the missing brace and still throws that, then something else is causing this. – Funk Forty Niner Apr 22 '16 at 17:33
  • @Fred-ii- That would be unexpected end of file ;) I bet on either wrong file. Weird character in source code or not showing the real code. – Rizier123 Apr 22 '16 at 17:34
  • @Rizier123 You're right. Well, feel free to reopen if you want. OP's going to have to provide more information/code. – Funk Forty Niner Apr 22 '16 at 17:35
  • 1
    @Fred-ii- The dupe covers all of my bets :P And to 99.9% the dupe will cover the error. – Rizier123 Apr 22 '16 at 17:36
  • is there a place where i can upload the full code and post a link here? because is a bit too long to post it as a comment thanks for the interest – javier Apr 22 '16 at 17:36
  • @javier You can make up a pastebin file if you want. http://pastebin.com/ add the link to the question but do NOT make it expire. – Funk Forty Niner Apr 22 '16 at 17:37
  • @Fred-ii- thanks i pasted the code there http://pastebin.com/Px2Gc83m – javier Apr 22 '16 at 17:41
  • @javier You're welcome and I added the link to your question at the bottom as an edit and added the wordpress tag. I don't know WordPress so I won't be able to help you there. If `$atts` needs to be assigned from somewhere, then check for that and with error reporting http://php.net/manual/en/function.error-reporting.php. Then there's `add_shortcode()` which is using 2 parameters. See if one of those are failing somewhere. – Funk Forty Niner Apr 22 '16 at 17:47
  • @Fred-ii- i think the problem was originated when i moved/replaced files from filezilla to the server maybe it change the format or something like that because everytime i replaced a file from filezilla that file started to show an syntax error, i puted everything on a zip file and uploaded directly via cpanel and everything is working fine now. Thanks for your help – javier Apr 22 '16 at 19:17
  • @javier You're welcome and glad to hear the problem's been resolved, *cheers* – Funk Forty Niner Apr 22 '16 at 19:38

0 Answers0