Manual placement

Home Page Forums WP Related Items Manual placement

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  WebshopLogic 1 year, 8 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)

  • Author

    Posts

  • #8786


    vk

    Participant

    Hello,
    is it possible to include related posts directly into my theme template file instead of creating a widget area and adding bulk code to the site? I’ve read there are no shortcodes to add, but a direct call to WRI function would be great.

    Reason? Related posts are placed on a wrong position, since there is a couple of other plugins getting in the way (social buttons, comments etc)

    thanks
    Viktor

    #8802


    WebshopLogic

    Keymaster

    Hello Viktor,

    You can place related items just below or above the post content, or into a widget area.
    Perhaps the WP Custom Widget area plugin or other similar plugin solves this problem. (I have not tried yet)

    Best Regards,

    Peter Rath
    WebshopLogic

    #8816


    vk

    Participant

    Hello Peter,

    I know of those options, but still in some cases they don’t properly solve the issue and add another bulk to the site.
    What if there is another plugin, which adds it’s content just between post content and post meta? Then the placement below post for WRI fails.

    Sorry, but having to install another plugin to do a simple job seems like total nonsense to me, if most of the plugins include a simple function to put in your template files, like if(function_exists(wri)) : wri(); endif; (take for example Social Warfare or Facebook comments)

    thanks
    Viktor

    #8830


    vk

    Participant

    Hello Peter,

    I’ve ended up using the widget, but came across a problem. I’m on Multisite and basically have two blogs which are technically clones. They use the same plugins, the same theme etc, just the content is different.

    I didn’t enable your plugin in the network, but instead I’ve activated it on each of the blogs. Then I’ve copied all the YARPP and WRI settings exactly. On the second blog the widget doesn’t even show up. Where could be the problem?

    thanks
    Viktor

    #8846


    WebshopLogic

    Keymaster

    Order of the displayed content above and below of your main content (with other plugins)

    What if there is another plugin, which adds it’s content just between post content and post meta? Then the placement below post for WRI fails.

    You can use the following WordPress filter functions to change the order of your content inserted by different plugins. Change the number 1 values in the last two lines as you need it, the smaller the number, the more ahead the content. The applicable value depends on the other plugins you are using.

    // Remove the content that was inserted with the original 1200 priority
    remove_filter( 'the_content', array( $GLOBALS['wri'], 'the_wri_content_page_top' ), 1200 ); 	// 1200 is the original priority that is deleted here (top of the page)
    remove_filter( 'the_content', array( $GLOBALS['wri'], 'the_wri_content_page_bottom' ), 1200 );	// 1200 is the original priority that is deleted here (bottom of the page)
    
    // Insert the content with the new priority, change number 1 as you need it (the smaller the number, the more ahead the content):
    add_filter( 'the_content', array( $GLOBALS['wri'], 'the_wri_content_page_top' ), 1 );			// 1 is the new priority that we are setting now (top of the page)
    add_filter( 'the_content', array( $GLOBALS['wri'], 'the_wri_content_page_bottom' ), 1 ); 		// 1 is the new priority that we are setting now (bottom of the page)

    Template files
    WRI uses YARPP in the background, and YARPP has a very good templating feature, that can be uses. Please find more information about YARPP templates in YARPP documentation.

    Multisite environment
    In WordPress Multisite environment you have to activate the plugin per site basis. So please do not use network activation, you can activate it on each site.

    Similar content must be found on every site, if you’ve activated and configured the plugin on all sites. If there is a problem, please provide more information and screenshots about the settings.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Social media & sharing icons powered by UltimatelySocial