WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Issuu] Embedding ISSUU using custom_fields (2 posts)

  1. ctrlspatie
    Member
    Posted 4 years ago #

    The following might help someone:

    My Goal:

    • Display an introduction + image on the front page
    • Display the ISSUU-embed on the single-post-page (single.php)
    • Remove the sidebar to make space for the ISSUU-embed

    Here's how you can achieve this:
    0. Install the plugin

    1. Create custom wordpress-category-templates. Check here.

    2. Make a single_issuu_post.php for your ISSUU documents. embed it in your single.php file.

    3. Remove the sidebar code
    <?php get_sidebar(); ?>

    4. Add the WordPress ISSUU embed code in a custom field (I called it "issuu_embed_link")

    5. Add the following code in single_issuu_docs.php

    <?php
      $this_post_id = the_ID();
      $custom_fields = get_post_custom( $this_post_id );
      $my_custom_field = $custom_fields['issuu_embed_link'];
      foreach ( $my_custom_field as $key => $value )
         //Call the ISSUU parsing function from the plugin
         echo(issuu_parse($value));

    I removed <?php the_content(); ?> because I did not want to show my "front-page introduction".

  2. ctrlspatie
    Member
    Posted 4 years ago #

    $this_post_id = the_ID();

    in the code snippet above should be:

    $this_post_id = get_the_ID();

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags