Viewing 7 replies - 1 through 7 (of 7 total)
  • Same problem with WP3.9.2 and last EPA version.

    Seems to come from bad interpretation of render_style_block() function in EPA_Renderer.php.

    Thanks in advance for help about your wonderful plugin ??

    Zabelle

    Same problem here. render_style_block seems to be the problem indeed. In the page source the <style> and </style> tags are not rendered. I cannot figure out what goes wrong in the render_style_block function….

    I have rewritten the function like this. Still the same problem. Seems that WP itself removes inline style tags…

    protected function render_style_block() {
    // Calculate the width (in %) of each image
    $used_margin = $this->display_options [‘columns’] * 2;
    $width = floor ( (100 – $used_margin) / $this->display_options [‘columns’] );
    $output = ‘<style type=\”text/css\”>#{‘;
    $output .= $this->album_id;
    $output .= ‘}.epa-image{width:{‘;
    $output .= $width;
    $output .= ‘%;}</style>’;
    return $ouput;
    }

    Has anybody found a solution to this that doesn’t include using another plugin?

    I googled “.epa-image { width: 31%; }” and it came up with loads of sites that appear to be having the ame problem.

    I figured it out:

    in EPA_RENDER.php, change the following function:

    protected function render_style_block() {
    	// Calculate the width (in %) of each image
    	$used_margin = $this->display_options ['columns'] * 2;
    	$width = floor ( (100 - $used_margin) / $this->display_options ['columns'] );
    	return 'STYLO1#' . $this->album_id . ' .epa-image {width: ' . $width .'%;}STYLC1';
    STYLE;
    }

    then in your themes functions.php, add this:

    function change_epa_style_block($content){
    	$content = str_replace('STYLO1', '<style type="text/css">', $content);
    	$content = str_replace('STYLC1', '</style>', $content);
    	return $content;
    }
    add_filter( 'the_content', 'change_epa_style_block' );

    Once you’ve done that, you’ll have to go back into your albums and save them again.

    *edit*
    After you have changed/added the functions,
    you’ll need to edit the album and change the collumns then save it.
    then change the collumns back to what you want then save it again.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Unwanted text inside content’ is closed to new replies.