Forum Replies Created

Viewing 9 replies - 16 through 24 (of 24 total)
  • Thread Starter roelani

    (@roelani)

    Found where the bug is coming from.

    Function on line 167 of /lib/vendor/josantonius/wp_menu/src/WP_Menu.php

    /**
    * Validate permissions.
    *
    * @since 1.0.2
    *
    * @uses current_user_can() → specific capability
    * @uses wp_die() → kill WordPress execution and show error
    */
    private static function _checkPermissions($capability) {

    if (!current_user_can($capability)) {

    $message = __(‘You don\’t have permissions to access this page.’);

    wp_die($message);
    }
    }

    For some reason, the $capabillity is either not correct or not passed properly. Changing the line to:

    if (!current_user_can(‘publish_posts’))

    makes it work for editors and contributors. ‘manage_options’ is an administrator-only cap. I’m not sure this is what should be called there. Regardless, even if it’s the right permission level, for some reason it just straight up kills the dashboard access, all pages of the dashboard, not simply the plugin pages.

    @mc_jesse, I think the OP already has their WordPress language defined and configured properly, since the back end is in french on his/her install.

    @nohant, the problem you’re looking stems from the plugin trying unsuccessfully to load a language (.mo) file from its /po/ directory. Open up mailchimp.php in your /plugins/mailchimp directory; around line 58, you’ll see this bit of code:

    function mailchimpSF_plugin_init() {
    	// Internationalize the plugin
    	load_plugin_textdomain( 'mailchimp_i18n', MCSF_DIR.'po/');

    This is the bit that tells the plugin to load up the appropriate language file based on your WordPress installation language. It seems it can’t find the right directory in some cases though. Just change it to:

    function mailchimpSF_plugin_init() {
    	// Internationalize the plugin
    	load_plugin_textdomain( 'mailchimp_i18n', false, dirname(plugin_basename( __FILE__ )) . '/po');

    This should make everything work again, and your Mailchimp plugin options in the back end will now also be in the correct language instead of the default english.

    Thread Starter roelani

    (@roelani)

    Whoopee! Finally, thanks to some php fiddling, I’ve managed to output exactly what I want. Here’s a recap for those who’d like to do the same thing.

    I want to avoid any and all duplicate posts on the home page.

    I’m using a theme where I have a featured slider at the top of the page. I’ve modified it because it used a featured category and I preferred to use the sticky post function for ease of use. So, that’s variable one, the ids of all sticky posts. My featured slider outputs an array of all post ids it queries through the $ids variable. One down.

    Next, right under the slider, there’s a “featured post from category” area which displays the very latest post from 4 different categories using 4 custom queries. Easy enough to pull the post ids from those. Right at the end of each loop, before wp_reset_query(); I’ve added global $post; $cat1_ID = $post->ID; for each category ($cat_ID1, $cat_ID2, etc…).

    So. That’s all the posts I don’t want duplicated right underneath in the “latest posts” blog area. Using the array merge function ambrosite suggested gives me the following setup:

    $featured_cat_posts=array(
    		'a' => $cat1_ID,
    		'b' => $cat2_ID,
    		'c' => $cat3_ID,
    		'd' => $cat4_ID,
    	);
    $all_ids = $featured_cat_posts + $ids;

    This merges the two arrays and preserves all the post ids without overwriting anything in the two arrays ($featured_cat_posts uses a,b,c,d and $ids uses 0,1,2,3). Then I query again to list all recent posts, using my merged array to exclude duplicates:

    $args=array(
    		'post__not_in' => $all_ids,
    		'paged'=>$paged,);
    query_posts($args);

    Shazaam. It works. Not sure how “grammatically” correct it is, as I’m no php expert, but I’m not getting any errors ;). No duplicates, all content sorted properly. You can see it in action here. Thanks very much to ambrosite for the suggestion. ??

    Thread Starter roelani

    (@roelani)

    Thanks ambrosite, will try to play with that for a while, see if it gives me what I need. ??

    Thread Starter roelani

    (@roelani)

    Yeah, I figured as much. I already tried to do it that way, however my “exclude stickies” function already dumps an array of stickied posts into ‘post__not_in’ and I couldn’t find a way to merge the two.

    … I’m no php crack, so probably there’s an easy way to do it, I just haven’t found it yet.

    roelani

    (@roelani)

    I have the same problem, and it happens on several different sites running different versions of wordpress. Ask.com -never- works.

    Same here. Running WPMU 2.9.1.1 and the new BP 1.2 beta. Clicking the Geo options link in the admin sidebar redirects to a /?c=1 page, which defaults to Dashboard view.

    Anyone found a way to do this? I’m also in the same situation, although I’m using a function to determine whether a post in my query has a particular custom_field. Everything works, except the query runs through the posts, then outputs the number of posts dictated in showposts minus the number of posts excluded by the custom_field function.

    … So it’s somewhat broken on my end too.

    I’m on 1.3.5 NGG and WP 2.8.1 and I also have this problem. Automatic resizing in the sidebar widget is definitely broken.

Viewing 9 replies - 16 through 24 (of 24 total)