• Resolved liv101

    (@liv101)


    Hi

    I was trying to change number of products per row from 4 to 1.
    I found a helpful thread and followed instructions to look for a specific code to edit or add a specific code, if it didn’t exist. Since I couldn’t find it, I added the code in custom woocommerce css, at the end:
    add_filter(‘loop_shop_columns’, ‘loop_columns’);

    if (!function_exists(‘loop_columns’)) {

    functionloop_columns() {

    return 1; // 1 products per row

    }

    }

    As in instructed From:
    https://www.themelocation.com/how-to-change-number-of-products-per-row-in-products-page/

    It didn’t work, so I removed it again, however on updating the file I got the following:
    Parse error: syntax error, unexpected ‘{‘ in /var/www/lenebay.dk/public_html/wp-content/themes/virtue/lib/custom-woocommerce.php on line 243

    Line 243 is a blank line between the following:
    if (!function_exists(‘loop_columns’)) {

    functionloop_columns() {

    No matter what I do now, the same error comes up and I’m unable to view any of my pages, dashboard or anything… In case I miscalculated I changed it to:
    if (!function_exists(‘loop_columns’)) {

    functionloop_columns(1) {

    I reeeaaally hope one of you have some wise words to recover my work!As I’m at my wits end…. I really din’t understand how the error can still be in place, when the line doesn’t exist…

    Big thanks in advance
    Liv

Viewing 13 replies - 1 through 13 (of 13 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    There should be a space between “function” and “loop_columns(1)”:

    function loop_columns() {

    Thread Starter liv101

    (@liv101)

    Thanks, but didn’t do the trick…

    Could it somehow have jammed itself?

    Thread Starter liv101

    (@liv101)

    Got any more advice??? I can’t access ANY other function than the CSS page in question…… wouldn’t even know how to reset my theme or anything…

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you simply re-upload this particular file?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can download the theme’s files again, extract the files from the zip format. Find the file that you modified. Then upload and overwrite it to the destination of the file that you modified.

    Thread Starter liv101

    (@liv101)

    Nope ??

    Am having to tell myself that I’m not really stupid ??

    I found the theme on www.ads-software.com, so it’s downloaded, but I can’t upload as it won’t let me enter themes….

    I can go back, but not forward – and now I’m no longer on the CSS page with the error and it won’t let me click on it – basically, every time I click on anything it sends me to the error page….

    I can’t go into my account profile either!

    Am starting to think, I need some kind of resetting of the whole thing ??

    Thread Starter liv101

    (@liv101)

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you copy all of the file’s code and put it into PasteBin for us to see: https://pastebin.com/

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The file that has the error

    Thread Starter liv101

    (@liv101)

    I’m sorry, I can’t acces that file or anything else any longer.

    As I tried to explain earlier, I used the back button from the errormessage page to go back to the editpage, went one too far and couldn’t go ‘forward’ to get back from it.

    It won’t even display loginoptions from any browser

    Right now I’m completely cut off from it!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Oh I see. What you need is access to your hosting provider’s “control panel”. This is separate from WordPress. The control panel should provide you with a tool to upload files, something like “File manager”. That should give you access to the files with the issue, and maybe even allow you to overwrite files by uploading them.

    Thread Starter liv101

    (@liv101)

    Okey – so far so good. I will have to get the info on hosting provider from my client tomorrow and give that a try. Fingers crossed!

    Thanks for helping – I’ll report back later ??

    Thread Starter liv101

    (@liv101)

    YES – IT WORKED ??????

    I was able to acces the file through the host provider and insert the space you mentioned in your first comment!

    Thank you thank you thank you ????????????

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Parse error: syntax error, in line 243’ is closed to new replies.