Written in response to image onclick!:
Gabriel was OK, but it seems that Luis helped editing the files
Written in response to image onclick!:
Written in response to Misalignment:
Written in response to Styling a list in a widget:
#execphp-4 li {
list-style: none;
padding: 8px 0 6px 0;
border-bottom: 1px solid #fefefe;
}
#execphp-4 li:last-child {
border: none;
}
Written in response to duplicate a field without plugin:
$data = unserialize(get_post_meta($post->ID, 'videos', true));
foreach ($data as $item) : ?>
<li>
<a href="<?php echo $item['url'] ?>">
<?php echo $item['title'] ?>
</a>
</li>
<?php endforeach ?>
Written in response to Finish custom post type:
Written in response to Product Catalog using Custom Post Types:
Written in response to why can't i transfer this theme over?:
<?php
function widget_sf_feed($args)
{
ob_start();
if ($args) extract($args);
if (!get_option(THEME_PREFIX . "rss_order")) {
add_option(THEME_PREFIX . "rss_order", 2);
update_option(THEME_PREFIX . "rss_order", 2);
}
$more_url = get_option(THEME_PREFIX . "feed_site");
if( isset($args["more_url"]) && !empty($args["more_url"]) ) {
$more_url = $args["more_url"];
}
$args["description"] = '';
if( isset($args["description"]) && !empty($args["description"]) ) {
$description = $args["description"];
}
// Get RSS Feed(s)
include_once(ABSPATH . WPINC . '/feed.php');
// Get a SimplePie feed object from the specified feed source.
//$feed_url = get_option(THEME_PREFIX . "feed_url");
//$rss = fetch_feed('' . $feed_url . '');
$abbr_array = array();
if ($args["feeds"]) {
$abbr_array = explode("+",$args["feeds"]);
}
$show_excerpt = 1;
if (isset($args["excerpt"])) {
$show_excerpt = intval($args["excerpt"]);
}
$feeds_arr = array();
$feeds_logo_arr = array();
$feeds_title_arr = array();
$feed_order = get_option(THEME_PREFIX . "rss_order");
for ($i = 1; $i < $feed_order; $i++) {
if (((sizeof($abbr_array) > 0) && in_array(get_option(THEME_PREFIX . "rss_abbr".$i), $abbr_array)) || (!sizeof($abbr_array))) {
array_push($feeds_arr, get_option(THEME_PREFIX . "rss_name".$i));
array_push($feeds_title_arr, get_option(THEME_PREFIX . "rss_title".$i));
array_push($feeds_logo_arr, get_option(THEME_PREFIX . "rss_logo".$i));
}
}
if (isset($args["columns"]) && ($args["columns"] >= 1) && (count($feeds_arr) > 0) ) {
$i = 0;
foreach($feeds_arr as $k=>$feed_url) {
$rss = fetch_feed('' . $feed_url . ''); ?>
<div id="rss-feed-columns" class="rss-feed-columns">
<div id="rss-feed-columns-header">
<h3><?php echo (empty($feeds_title_arr[$k])?'RSS':$feeds_title_arr[$k]) ?></h3>
<?php if (!empty($feeds_logo_arr[$k])) : ?>
<img src="<?php echo $feeds_logo_arr[$k] ?>" style="border:0; background:none; padding:0;" />
<?php else: ?>
<img src="<?php bloginfo('template_url') ?>/images/rss.png" style="border:0; padding:0;" />
<?php endif; ?>
</div>
<?php
// Figure out how many total items there are.
$rss_num = get_option(THEME_PREFIX . "rss_num");
if ($args["count"])
$rss_num = $args["count"];
if (!$rss -> errors)
$maxitems = $rss -> get_item_quantity($rss_num);
// Build an array of all the items, starting with element 0 (first element).
if (!$rss -> errors)
$rss_items = $rss -> get_items(0, $maxitems); ?>
<ul id="feed">
<?php if ($maxitems == 0): ?>
<li>No items.</li>
<?php else: ?>
<?php foreach ( $rss_items as $item ) : // Loop through each feed item and display each item as a hyperlink. ?>
<li>
<h2<?php echo (!$show_excerpt ? ' class="excerpt"' : '') ?>>
<a href="<?php echo $item -> get_permalink();?>" title="<?php echo (!$show_excerpt ? strip_tags($item->get_description()) : 'Posted '.$item->get_date('j F Y | g:i a'))?>" target="_blank"><?php echo $item -> get_title();?></a></h2>
<?php if ($show_excerpt) : ?>
<p>
<?php echo strip_tags($item -> get_description());?>
</p>
<?php endif ?>
</li>
<?php endforeach ?>
<?php endif ?>
</ul>
<div id="feed-last-item-columns">
<!-- nothing to see here -->
</div>
<!--<a href="<?php echo $more_url?>" title="" target="_blank">View More</a>-->
</div>
<!-- feed-feed -->
<?php if( $i && ($i%3==2) ) : ?>
<div style="clear:both; border-bottom:0px solid #CACACA;">
</div>
<?php endif ?>
<?php
$i++;
} // endforeach
} else {
$rss = fetch_feed($feeds_arr); ?>
<div id="rss-feed" class="content-item">
<div class="content-dets">
<h3>Related on the web</h3>
<?php if (count($feeds_arr) == 1 && !empty($feeds_logo_arr[0])) : ?>
<img src="<?php echo $feeds_logo_arr[0] ?>" align="left" style="border:0; background:none; padding:0;" />
<?php else : ?>
<?php if (!empty($more_url)) : ?>
<ul class="dets">
<li class="rss-link"><img src="<?php bloginfo('template_url')?>/images/rss.png" style="border:0; padding:0;" /><a href="<?php echo $more_url?>" title="" class="rss-link" target="_blank">View More</a>
</li>
</ul>
<?php else: ?>
<img src="<?php bloginfo('template_url')?>/images/rss.png" style="border:0; padding:0;" />
<?php endif ?>
<?php endif ?>
<?php if (!empty($description)): ?>
<p><?php echo $description ?></p>
<?php endif ?>
<!--<ul class="dets">
<li class="rss-feed-link"><a href="<?php echo $more_url?>" title="<?php echo get_option(THEME_PREFIX . "feed_name"); ?>" target="_blank">View More</a></li>
</ul>-->
</div>
<div class="content-body feed-container">
<?php
// Figure out how many total items there are.
$rss_num = get_option(THEME_PREFIX . "rss_num");
if ($args["count"])
$rss_num = $args["count"];
if (!$rss -> errors)
$maxitems = $rss -> get_item_quantity($rss_num);
// Build an array of all the items, starting with element 0 (first element).
if (!$rss -> errors)
$rss_items = $rss -> get_items(0, $maxitems); ?>
<ul id="feed">
<?php if ($maxitems == 0): ?>
<li>No items.</li>
<?php else: ?>
<?php foreach ( $rss_items as $item ) : // Loop through each feed item and display each item as a hyperlink. ?>
<li>
<h2<?php echo (!$show_excerpt ? ' class="excerpt"' : '') ?>>
<a href="<?php echo $item->get_permalink() ?>" title="<?php echo (!$show_excerpt ? strip_tags($item->get_description()) : 'Posted '.$item->get_date('j F Y | g:i a'))?>" target="_blank"><?php echo $item -> get_title();?></a></h2>
<?php if ($show_excerpt): ?>
<p><?php echo strip_tags($item -> get_description());?></p>
<?php endif ?>
</li>
<?php endforeach ?>
<?php endif ?>
</ul>
<div id="feed-last-item">
<!-- nothing to see here -->
</div>
</div>
</div>
<!-- feed-feed -->
<?php } ?>
<?php if (!$args["widget_name"]): ?>
<style>
#rss-feed {
padding-left: 0px;
width: 660px !important;
border-bottom: none;
margin-top: 15px !important;
}
#rss-feed .content-dets h3 {
margin-top: 0px;
}
/*#rss-feed .content-body {
width:440px !important;
}*/
#rss-feed .content-dets {
width: 200px;
margin-left: 30px;
}
#rss-feed .content-body {
width: 490px !important;
}
#rss-feed li {
width: 490px !important;
}
</style>
<?php endif ?>
<?php
$result = ob_get_contents();
ob_end_clean();
return $result;
} // end function
register_sidebar_widget('Seven Five - Feed', 'widget_sf_feed');