Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi IIStevowII,

    can you help me fix the in_homepage variable error. My php is not the best, are you able to paste the code to where to place the isset()

    Thanks

    @iistevowii

    Yes it would be great if you can help fix this. I don’t really know PHP but a lot of people seem to have an issue with the truncated title. Maybe this ist the reason It looks very much like the plugin truncates the title of the actual post instead of the one next to the image of the related post which is what we want. Julio has apparently disappeared – I hope he is fine.

    Thread Starter IIStevowII

    (@iistevowii)

    On line 28 and 29 of the file /wp-content/plugins/baw-manual-related-posts/inc/frontend-noajax.inc.php I have added ” && isset($bawmrp_options[‘in_homepage’])” BEFORE “$bawmrp_options[‘in_homepage’]==’on'”

    if ( ( is_home() && isset($bawmrp_options['in_homepage']) && $bawmrp_options['in_homepage']=='on' && in_the_loop() ) ||
    	is_singular( $bawmrp_options['post_types'] ) ) {

    This problem could occur on more/different places. The error message tells you which file and line.

    @iistevowii

    Thanks for the code I did add it to the plugin but now I have a new error.

    Errors:
    Notice: Trying to get property of non-object in /Applications/MAMP/htdocs/digitaldeen/wp-content/plugins/baw-manual-related-posts/inc/backend-noajax.inc.php on line 186

    Warning: Cannot modify header information – headers already sent by (output started at /Applications/MAMP/htdocs/digitaldeen/wp-content/plugins/baw-manual-related-posts/inc/backend-noajax.inc.php:186) in /Applications/MAMP/htdocs/digitaldeen/wp-includes/pluggable.php on line 1121

    I’m tired of having to fix something that should just work. Nice idea but too buggy for me so need to find alternative now. Any suggestions anyone?

    Thread Starter IIStevowII

    (@iistevowii)

    What version are you using? Could you copy line 186 (And a few surrounding lines) of the file baw-manual-related-posts/inc/backend-noajax.inc.php

    Hi Steve,

    its version 1.8.1

    from line 172 till 193:

    add_action( 'save_post', 'bawmrp_purge_transient', 10, 2 );
    add_action( 'deleted_post', 'bawmrp_purge_transient', 10, 1 );
    add_action( 'clean_post_cache', 'bawmrp_purge_transient', 10, 2 );
    add_action( 'option_permalink_structure', 'bawmrp_purge_transient' );
    add_action( 'option_bawmrp', 'bawmrp_purge_transient' );
    add_action( 'transition_post_status', 'bawmrp_purge_transient', 10, 3 );
    function bawmrp_purge_transient( $a='', $b='', $c='' ) {
    	global $wpdb;
    	switch( current_filter() ) {
    		case 'clean_post_cache':
    		case 'save_post': $post_ID = $b->ID; break;
    		case 'transition_post_status': $post_ID = $c->ID; break;
    		case 'deleted_post': $post_ID = $a->ID; break;
    		default: $post_ID = ''; break;
    	}
    	$wpdb->query( "DELETE from $wpdb->options WHERE option_name LIKE '%bawmrp_{$post_ID}%'" );
    	if ( 'option_permalink_structure' == current_filter() || 'option_bawmrp' == current_filter() ) {
    		return $a;
    	}
    }

    thanks

    Thread Starter IIStevowII

    (@iistevowii)

    Very strange, I have version 1.8.1 myself but this error does not happen. I must say that my line 186 is something completely different. Are you sure you are looking a the correct file?

    My suggestion: Completely re-install the plugin and then make the change I’ve pasted above. That should fix it.

    Hi

    thanks I reinstalled the plugin as you said and added your code. But even before that I get errors, like:

    In the setting panel under ‘Display related posts in post content’ I get this:

    /Applications/MAMP/htdocs/digitaldeen/wp-content/plugins/baw-manual-related-posts/inc/setting_fields.inc.php on line 9

    And on homepage post I get this:

    Notice: Undefined index: in_content in /Applications/MAMP/htdocs/digitaldeen/wp-content/plugins/baw-manual-related-posts/inc/frontend-noajax.inc.php on line 25

    Im using WordPress Version 3.9.1

    Thread Starter IIStevowII

    (@iistevowii)

    Re-saving settings, does that help? It usually could help. I haven’t updated to 3.9.1 yet, so maybe that could be the problem. (I’m not planning on doing that either for a while after hearing what happend to you :-P)

    Otherwise I don’t really know what the problem could be without diving in the code, but that’s more the job of the author. I don’t really have the time for it.

    Tried re-saving the settings too and still getting the errors 🙁

    I removed the code below from frontend-noajax.inc.php on line 25 and in seems to work. Can you spot anything in the code which you think could causing problems. Does an isset need to applied somewhere?

    if ( ! $post || $bawmrp_options['in_content']!='on' && $content!='' || apply_filters( 'stop_bawmrp', false ) ) {
    return $content;
    }

    This Undefined index: in_content seems to be present on both errors I mentioned earlier.

    Sorry to bother you again and thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Undefined index: in_homepage’ is closed to new replies.