Forum Replies Created

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter cykeltomte

    (@cykeltomte)

    Ok, may have solved it:

    $content_array[] = apply_filters('the_content',get_the_content());

    Would this work?

    EDIT:
    Seems like it works ?? Thanks for all the help! It has really helped me alot. I’m forever in your debt, but i hope a simple thanks will suffice.

    Thread Starter cykeltomte

    (@cykeltomte)

    Aha, so that’s why my shortcodes doesn’t work. Thank you, your’e a lifesaver!

    But, when I try apply_filters() my page goes blank. At the moment, I do this to put the contents in an array:

    $content = get_the_content();
    array_push($content_array,$content);

    I’ve tried:

    array_push($content_array,apply_filters(get_the_content());

    And:

    $content_array[] = apply_filters(get_the_content());

    Which both gave the same result, a blank page. Any idea of what I’m doing wrong?

    EDIT:

    $content = get_the_content();
    $content = apply_filters($content);
    array_push($content_array,$content);

    This doesn’t result in a blank page, but no content shows up.

    Thread Starter cykeltomte

    (@cykeltomte)

    OK, solved it by placing the_content() of every post in an array which is cleared every third post.

    One question though, might it cause any problems to place the content in an array and posting it this way?

    Thread Starter cykeltomte

    (@cykeltomte)

    Ah, thought somthing like that could solve it, just didn’t know how to do it. Thanks!

    On to another problem (should I make a new thread maybe?). As you can see here https://scp.se/scpwp/ the content is expanded beneath every post, however, i need the content to fill the full width of the page/body. Is it possible to put the content of every post in to an array, which gets reset efter every row, to post the content of three posts beneath every row? Or is it better to call a loop inside the loop in some way?

    Thread Starter cykeltomte

    (@cykeltomte)

    Solved it by adding this code to functions.php.

    add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
    function special_nav_class($classes, $item){
    	$title = strtolower($item->title);
    	$classes[] = $title;
    	return $classes;
    }

    Not exactly what i had in mind, but it actually works better as it automatically adds the title of the menu item as a class.

    Thread Starter cykeltomte

    (@cykeltomte)

    Thanks! Making i file called image.php did the trick ??

Viewing 6 replies - 16 through 21 (of 21 total)