GithubHelp home page GithubHelp logo

cyclonecode / cision-block Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 220 KB

This plugin adds a shortcode and a widget that can be used for pulling and displaying pressreleases from cision.

Home Page: https://wordpress.org/plugins/cision-block

PHP 96.85% CSS 1.65% JavaScript 1.50%
cision content feed php plugin shortcode widget wordpress wordpress-plugin

cision-block's People

Contributors

cyclonecode avatar

Watchers

 avatar  avatar

Forkers

orrpan

cision-block's Issues

Add support for "latest news" view only one post without padding

Awesome plugin!
For now I'm using this, to see if there only is one post showing then it should only present the title in regular font (as for a first page "This is the latest news"). Would be awesome if this could be implemented some better solution for this!

The perfect solution would get the text in plaintext and no extra things

cision-block/templates/cision-block.php

?>

<section<?php echo $wrapper_attributes; ?>>
<?php echo $prefix; ?>
<?php if (count($cision_feed)) : ?>
    <?php foreach ($cision_feed as $item) : ?>
       <?php if (count($cision_feed) === 1) : ?>
            <p>
                <time><?php echo date($options['date_format'], $item->PublishDate); ?></time><br>
                <?php echo esc_html($item->Title); ?>
            </p>
        <?php else : ?>
        <article<?php echo $attributes; ?>>
            <h2><?php echo esc_html($item->Title); ?></h2>
            <time><?php echo date($options['date_format'], $item->PublishDate); ?></time>
            <p>
            <?php if (isset($item->Images[0])) : ?>
            <span class="cision-feed-item-media">
            <img
                    src="<?php echo esc_url($item->Images[0]->DownloadUrl); ?>"
                    alt="<?php echo esc_html($item->Images[0]->Description); ?>"
            />
            </span>
            <?php endif; ?>
            <?php print wp_trim_words(esc_html($item->Intro ? $item->Intro : $item->Body)); ?>
            </p>
            <?php if (isset($item->CisionWireUrl, $readmore)) : ?>
            <a
                    href="<?php echo esc_url($item->CisionWireUrl); ?>"
                    target="<?php echo $item->LinkTarget; ?>"
            ><?php _e($readmore, CISION_BLOCK_TEXTDOMAIN); ?></a>
            <?php endif; ?>
        <?php endif; ?>
    </article>
    <?php endforeach; ?>
<?php endif; ?>
<?php echo $pager; ?>
<?php echo $suffix; ?>
</section>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.