IntelliWidget Content Driven Featured Posts and Menus

Template Tags

IntelliWidget uses its own query to retrieve posts and does not use the standard WordPress “Loop.” (See “The Loop” in the WordPress Codex.) The query loads all of the postmeta data in one pass to reduce the number of database requests for a given page load. The IntelliWidget Loop behaves much like the WordPress Loop, but many functions have been removed for maximum performance.

To iterate through the IntelliWidget Loop, the following code must be present in each template:

<?php
if ($selected->have_posts()): while ($selected->have_posts()): the_post(); ?>

// ... content here ...

<?php endwhile; endif; ?>

IntelliWidget Template Functions

Templates use a set of functions designed for use with the IntelliWidget Loop to format output.

the_intelliwidget_ID()

  • Description
    Displays the post ID
  • Usage
    <?php the_intelliwidget_ID(); ?>
  • Parameters
    None.

get_the_intelliwidget_ID()

Same as the_intelliwidget_ID but returns the content as a string instead of outputting it directly.

the_intelliwidget_excerpt()

  • Description
    Displays a shortened version of the post content. It will use the post_excerpt value if it exists, otherwise it strips the post_content and shortens it to the number of words specified by the “Words Per Post” setting. If the excerpt was truncated, it appends ‘…’ to the end.
  • Usage
    <?php the_intelliwidget_excerpt(); ?>
  • Parameters
    None.

get_the_intelliwidget_excerpt()

Same as the_intelliwidget_excerpt but returns the content as a string instead of outputting it directly.

has_intelliwidget_image()

  • Description
    This Conditional Tag checks if the post has a featured image or if images are turned off for this Widget.
  • Usage
    <?php if (has_intelliwidget_image()){ /* do something */ } ?>
  • Parameters
    None.
  • Return Values
    (boolean) TRUE on success, FALSE on failure.

the_intelliwidget_image()

  • Description
    Displays the featured image of the post using the IntelliWidget’s “Image Size” setting to determine which thumbnail size to display, linked to the full image. Note: Intelliwidget constrains thumbnails to 25% of the width of the enclosing element. You can override this behavior with custom CSS.
  • Usage
    <?php the_intelliwidget_image(); ?>
  • Parameters

    • None.

get_the_intelliwidget_image()

Same as the_intelliwidget_image but returns the image as a string instead of outputting it directly.

  • Description
    Displays a link to the post or IntelliWidget Category. If the Post contains custom data fields for “intelliwidget_external_url” or “intelliwidget_alt_title,” they will be used instead.
  • Usage
    <?php the_intelliwidget_link($id , $text, $category_ID); ?>
  • Parameters

    • $id (integer) (optional) The integer ID for a post or page, or a post object
      Default: The current post ID, when used in The IntelliWidget Loop.
    • $text (string) (optional) The text to display inside the link. Defaults to the post title, or “intelliwidget_alt_title” custom field value if it exists.
    • $category_ID (integer) (optional) The ID of a category. If this value is not NULL, the link will display the permalink to the category archive page instead of to the post itself.

get_the_intelliwidget_link()

Same as the_intelliwidget_link but returns the link as a string instead of outputting it directly.

get_the_intelliwidget_url()

  • Description
    Returns just the url of the post or IntelliWidget Category, not a complete <a> container. Useful when you need to put additional code inside the link.
  • Usage
    <?php $url = get_the_intelliwidget_url( $id, $category_ID ); ?>
  • Parameters

    • $id (integer) (optional) The integer ID for a post or page, or a post object
      Default: The current post ID, when used in The IntelliWidget Loop.
    • $category_ID (integer) (optional) The ID of a category. If this value is not NULL, the link will return a permalink to the category archive page instead of to the post itself.
  • Return Values
    (string) The post permalink or “intelliwidget_external_url” custom field value if it exists.

the_intelliwidget_title()

  • Description
    Displays Post Title. If the Post contains custom data field “intelliwidget_alt_title,” it will be displayed instead.
  • Usage
    <?php the_intelliwidget_title(); ?>
  • Parameters

    • None.

get_the_intelliwidget_title()

Same as the_intelliwidget_title but returns the title as a string instead of outputting it directly.

the_intelliwidget_content()

  • Description
    Displays the full Post content. Note: This function will display the entire contents of the post, ignoring any <–nextpage–> tags. Use with caution.
  • Usage
    <?php the_intelliwidget_content(); ?>
  • Parameters

    • None.

get_the_intelliwidget_content()

Same as the_intelliwidget_content but returns the content as a string instead of outputting it directly.

the_intelliwidget_date()

  • Description
    Displays the Start Date (custom data field) of the post if it exists using the format provided as the function argument. If there is no Start Date value, the Post Date is returned instead.
  • Usage
    <?php the_intelliwidget_date( $format ); ?>
  • Parameters

    • $format (string) (optional) A PHP date format string. See the PHP documentation for valid date format syntax. Defaults to ‘j’ (day of month)

get_the_intelliwidget_date()

Same as the_intelliwidget_date but returns the date as a string instead of outputting it directly.

the_intelliwidget_exp_date()

  • Description
    Displays the Expire Date (custom data field) of the post if it exists using the format provided as the function argument.
  • Usage
    <?php the_intelliwidget_exp_date( $format ); ?>
  • Parameters

    • $format (string) (optional) A PHP date format string. See the PHP documentation for valid date format syntax. Defaults to ‘j’ (day of month)

get_the_intelliwidget_exp_date()

Same as the_intelliwidget_exp_date but returns the date as a string instead of outputting it directly. If there is no Expire Date value or if the Expire Date is the same as the Start Date, the function returns false.

the_intelliwidget_author_meta()

  • Description
    Displays any of several meta data fields associated with the author of the post. The function accepts the field to retrieve as its single argument. See WordPress Codex for the list of available fields.
  • Usage
    <?php the_intelliwidget_author_meta( $field ); ?>
  • Parameters

    • $field (string) (optional) The name of the data field requested. Defaults to ‘display_name’ if no field is passed.

get_the_intelliwidget_author_meta()

Same as the_intelliwidget_author_meta but returns the field as a string instead of outputting it directly. If there is no value, the function returns false.

the_intelliwidget_postmeta()

  • Description
    Displays any of several meta data fields associated with the post. The function accepts the field to retrieve as its single argument. See WordPress Codex for the list of available fields.
  • Usage
    <?php the_intelliwidget_postmeta( $field ); ?>
  • Parameters

    • $field (string) (optional) The name of the data field requested. Function returns false if no field is passed.

get_the_intelliwidget_postmeta()

Same as the_intelliwidget_postmeta but returns the field as a string instead of outputting it directly. If there is no value, the function returns false.

Need More Help? Contact Us!

Maintaining our reputation for excellent support is very important to us, so please do not hesitate to ask any question about this or any of our other plugins. You can also use the Child Theme Configurator Support Forum on WordPress.org. Don't forget to give us 5 stars!