Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter renrutsirhc

    (@renrutsirhc)

    Hi,

    I’m not sure I follow your suggestion. I know you can add a background image to a div element using css. Is this what you mean? If so which div element do you suggest I target?

    Surely the better solution is to amend the plug-in so it pulls the featured image through for the homepage in the same way it does for other pages?

    Thanks
    Chris

    Thread Starter renrutsirhc

    (@renrutsirhc)

    Sure: it’s https://www.karlanorton.co.nz

    Thanks
    Chris

    Thread Starter renrutsirhc

    (@renrutsirhc)

    I’m using the plug-in:

    https://wordpress.org/plugins/php-compatibility-checker/

    to do a preliminary check of my site for php 7 compatability.

    The plugin throws the following complaints after running:
    FILE: /plugins/youtube-showcase/includes/common-functions.php
    ————————————————————————————————–
    FOUND 1 ERROR AFFECTING 1 LINE
    ————————————————————————————————–
    138 | ERROR | Global with variable variables is not allowed since PHP 7.0
    ————————————————————————————————–

    FILE: /plugins/youtube-showcase/includes/integration-shortcodes.php
    ——————————————————————————————————–
    FOUND 1 ERROR AFFECTING 1 LINE
    ——————————————————————————————————–
    28 | ERROR | Global with variable variables is not allowed since PHP 7.0
    ——————————————————————————————————–

    FILE: /plugins/youtube-showcase/includes/shortcode-functions.php
    —————————————————————————————————–
    FOUND 6 ERRORS AFFECTING 6 LINES
    —————————————————————————————————–
    139 | ERROR | Global with variable variables is not allowed since PHP 7.0
    167 | ERROR | Global with variable variables is not allowed since PHP 7.0
    173 | ERROR | Global with variable variables is not allowed since PHP 7.0
    176 | ERROR | Global with variable variables is not allowed since PHP 7.0
    335 | ERROR | Global with variable variables is not allowed since PHP 7.0
    403 | ERROR | Global with variable variables is not allowed since PHP 7.0
    —————————————————————————————————–

    On examining the code, the plug-in is correct. Here is the first example:
    global $$glob_limit,$$glob_orderby;

    From the php7.0 manual:

    ‘global only accepts simple variables

    Variable variables can no longer be used with the global keyword. The curly brace syntax can be used to emulate the previous behaviour if required:
    <?php
    function f() {
    // Valid in PHP 5 only.
    global $$foo->bar;

    // Valid in PHP 5 and 7.
    global ${$foo->bar};
    }
    ?>

    As a general principle, using anything other than a bare variable with global is discouraged.’

    Hopefully this provides you with al the info you need?

    Many Thanks!
    Chris

    renrutsirhc

    (@renrutsirhc)

    I am seeing exactly the same thing running the generatepress theme.

    https://www.karlanorton.co.nz/recipes/
    https://www.karlanorton.co.nz/recipes/amp/

    Any ideas on how to fix this?

    Thread Starter renrutsirhc

    (@renrutsirhc)

    Hi there,

    So I think my question was not very good and I’ve since done quite a bit of research into this. Here is a complete description of the problem:

    I am using tribe_get_events_title(); to generate a second copy of the title which appears as white text over a full width image (created using generatepress). See the url below:

    https://www.karlanorton.co.nz/performances/

    Now this works great when you first navigate to the page or if you refresh the page form the browser. However, when you use any of the ajax links (e.g. previous performances) or buttons which only do a partial refresh of the page, the function doesn’t re-run and so you are left with the title in white which is no longer appropriate to the content being shown.

    Any ideas how to get this working?

    Thanks so much!
    Chris

    Thread Starter renrutsirhc

    (@renrutsirhc)

    OK – the second I posted this – I discovered the function: tribe_get_events_title();

    Now I have a weird problem – the titles in white change perfectly when using the main menu for navigation. When using the links on the page which say ‘next performances’ and ‘previous performances’ the titles in white don’t update.

    Cheers
    Chris

    Sure:

    http://test.karlanorton.co.nz/wordpress/performances/lunchtime-concert/

    is the page I’ve been doing all my testing on at the moment. The Theme is GeneratePress using their Premium Header PLug-in.

    Thanks for your suggestion. This looks like it will cause problems with the theme I’m using.

    I’m attempting to use jQuery to set the css for the background-position property. this is working well using test variables.

    I was hoping you might be able to point me in the right direction for how I might return the variable data-smartcrop-focus using jQuery which seems to contain the info I need.

    Thanks
    Chris

    Hi there,

    I’m experimenting with this at the moment as well.

    This css is working beautifully to refocus the background images to a focus point I specify manually.

    https://www.w3schools.com/cssref/pr_background-position.asp

    What I am wondering is whether it is possible to use the focus point set by wp SmartCrop as a variable that the CSS can use as its focus point.

    Many Thanks in advance for your help!
    Chris

    Thread Starter renrutsirhc

    (@renrutsirhc)

    Yep afraid so – no luck!

Viewing 10 replies - 1 through 10 (of 10 total)