• Hi all, I need to show the content of a site in my theme on two different places! It’s supposed to work something like this:
    -some delimiter-some formatted content-some delimiter
    -some delimiter-some other formatted content-some delimiter
    I’ve tried something with regexes but this didn’t work out (I’m not very good with this). Maybe someone can help me please? 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Ners,

    You can work with post in your website. There is an option in your theme to select the page where you want this post. For example, you have your homepage and under blog you want to get all your post. You select in your theme that you want a static page and all your posts under blog.

    If you want a second place in your meny where you can find the blogs, you can work with tags. For example the tag “blog”. Add this to all your posts. Place the link domain.com/tags/blog at the right place in your menu bar.

    Thread Starter ners10100100

    (@ners10100100)

    Sorry, I forgot, no posts or custom fields or similar stuff, I need it from the main wysiwyg editor…

    I am not sure if this will work. Maybe you can search for an embed plugin to embed your post in your page.

    The only way what could work is a feed page with all your post, like a news or blog page.

    if not used for other reasons, you could consider to use the <!--more--> tag or <!--nextpage--> tag.

    not sure what ‘some delimiter’ would be…

    Thread Starter ners10100100

    (@ners10100100)

    Hey, I was able to fix it by doing something like this:

    $id=1;
    $post = get_post($id);
    $content = apply_filters('the_content', $post->post_content);
    $headers = explode('xxx', $content);

    -where xxx is the delimiter.
    Now I’m able to get the First part of the content like $headers[0] and the second part with $headers[1]

    Thank you for your replies! 🙂

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

The topic ‘Split content in template’ is closed to new replies.