• Resolved BK_@_UC

    (@bk_uc)


    Do you have a sample function to use in functions.php to modify the output for the filters?

    add_filter('bawmrp_thumb_size','hack_plugin_manual_related_posts');
    function hack_plugin_manual_related_posts(){
    
     //what should be here? should it return a variable? This requires an array in the core file.
    
    }
    add_filter( 'bawmrp_li_style', 'hack_bawmrp_li_style' );
    function hack_bawmrp_li_style(){
    	$style =  "max-height:10px;overflow:hidden;list-style:none;text-align:center;";
    }

    How should these be used? Thanks much!

    https://ww.wp.xz.cn/plugins/baw-manual-related-posts/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Julio Potier

    (@juliobox)

    Hello

    add_filter('bawmrp_thumb_size','hack_plugin_manual_related_posts');
    function hack_plugin_manual_related_posts(){
    
      return array( '600', '300' ); // width x height 
    
    }
    add_filter( 'bawmrp_li_style', 'hack_bawmrp_li_style' );
    function hack_bawmrp_li_style(){
    	$style = "max-height:10px;overflow:hidden;list-style:none;text-align:center;"; // modify what you need
      return $style;
    }

    In a next update (2.0) i will add a template engine 😉

    Thread Starter BK_@_UC

    (@bk_uc)

    Great! Thanks so much.

    Thread Starter BK_@_UC

    (@bk_uc)

    Hello, I would like to hire you to write a customized output function if you are available.

    I need this plugin to output a version of the featured image that uses a custom image size. Basically it would be the same url as the featured image, but with “-300×250” appended to the end but before the file extension.

    before
    imagepath/imagename.png

    after
    imagepath/imagename-300×250.png

    Are you available? What would the cost be?

    Thanks in advance!

    Plugin Author Julio Potier

    (@juliobox)

    hello

    i've got a hook for this logically
    add_filter('bawmrp_thumb_size','hack_plugin_manual_related_posts');
    function hack_plugin_manual_related_posts(){
    
    return( array( 300, 050 ) );
    
    }

    test and feedback me

    Thread Starter BK_@_UC

    (@bk_uc)

    Again, thanks for the personal attention!

    I have tried a variety of things but not gotten the result I need. My sidebar has a ads that are 300×250 images and the site is responsive so they scale. Thus my Related Posts need to be images that are the same size so they stay in proportion with other sidebar elements.

    To solve this I have created a custom image size in the Media uploader @ 300×250 so the large images are uploaded, then featured image and ad sizes are created as well with hard crop.

    WordPress automatically appends “-300×250”:
    Birth_11_styleguide-002-300×250.jpg

    I just need the post image with the “-300×250” appended to the path and no image sizes written into the tag and everything will fall into place.

    <img src="http://website.com/wp-content/uploads/2014/04/tpl-ad-300x250.png" alt="Ad Space GR1">
    `
    I imagine the way to do this is to get into the get_the_post_thumbnail() core function, but if there is a way to do this with an existing plugin filter that would be more future proof.

    Thanks for any thoughts.

    Plugin Author Julio Potier

    (@juliobox)

    ok look the next major update will include a template engine, so you should set the output yourself, easily
    thanks for your patience

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

The topic ‘Example function for filters?’ is closed to new replies.