WordPress.org

Ready to get started?Download WordPress

Forums

Achievements for WordPress
[resolved] Template inheritance broken with WP 3.8.1? (5 posts)

  1. jonzlin95
    Member
    Posted 6 months ago #

    Hey Paul,

    First I want to say that I love your work, on buddypress and this etc.

    So I created a custom version of the leaderboards sidebar widget for my site, which was working fine for Achievements v3.4.1, however upon upgrading wordpress to 3.8.1, the template inheritance from dpa_get_template_part() stopped working, and it defaults to the original plugin. I tried just changing the plugin from the wordpress plugins folder and it still seems to be working. Any ideas?

    Cheers,
    -Jonathan

    https://wordpress.org/plugins/achievements/

  2. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 6 months ago #

    If there is, you're the first person to say anything.

    * What version of WordPress did you upgrade from?
    * Did you make ANY other changes when you upgraded WordPress?
    * What template files did you override in your theme -- can you give me the exact path in your theme, please?

  3. jonzlin95
    Member
    Posted 5 months ago #

    Thanks for the reply Paul,

    I upgraded from WP3.6, Achievements 3.4.1 to WP 3.8.1, Achievements 3.5.1

    Upon upgrading wordpress, I also upgraded buddypress to the latest version 1.9.1

    The template file that I overrode was:
    achievements/templates/achievements/achievements/content-leaderboard-widget.php

    following a fix I found here: http://wordpress.org/support/topic/user-achievements-index-not-displaying

    I also overwrote the widget file itself at:
    achievements/includes/class-dpa-leaderboard-widget.php

    my theme is placed in /wp-content/themes/THEME_NAME/achievements

    My wordpress skills are pretty rudimentary, but I attempted to rewrite my changes for Achievements 3.5.1, WP3.8.1, but failed to get any sort of inheritance working with the theme, however, all the changes that I make to the plugin itself seem to be working fine (as in if I edit it from the plugin directory directly). As of now, I'm using that hack to get it showing, but this is far from a good solution ;).

    Cheers,
    -Jonathan

  4. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 5 months ago #

    I also overwrote the widget file itself at:
    achievements/includes/class-dpa-leaderboard-widget.php

    ^ This won't work, as you might have found out; only the template + CSS + JS files are able to be overriden.

    EDIT: assuming you meant you put it in to your theme folder into an /achievements/ subdir. If however you've added a copy of the new widget programatically, ignore me :)

    EDIT 2: let me reply better in a new post.

  5. Paul Gibbs
    BuddyPress Lead Developer
    Plugin Author

    Posted 5 months ago #

    The template hierarchy works for me for the content-leaderboard-widget.php file just fine. Like you say, I put it in /wp-content/themes/THEME_NAME/achievements/content-leaderboard-widget.php.

    Overriding files other than the CSS, JS, or templates from inside the templates folder will not work. Unless you've done some custom code to integrate your copy of the widget file, it won't be doing anything. I wonder if this has something to do with you not seeing the results you're expecting?

Reply

You must log in to post.

About this Plugin

About this Topic