I have a Jomi installation and I see that social icons are inserted at the bottom of my article while I would display them after the head section. What should I look for to modify this since the template settings just allow me to turn on/off the social bar? Should I look inside layouts or styles folder?
On feeling I looked into layouts/com_content/article and there is a default.php that looks something like a template for my articles, but I cannot find anything about social bar, here is its content:
<?php
/**
* #package Warp Theme Framework
* #author YOOtheme http://www.yootheme.com
* #copyright Copyright (C) YOOtheme GmbH
* #license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die;
// get view
$menu = JSite::getMenu()->getActive();
$view = is_object($menu) && isset($menu->query['view']) ? $menu->query['view'] : null;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $this->item->params->get('access-edit');
$user = JFactory::getUser();
?>
<div id="system">
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="title"><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>
<article class="item"<?php if ($view != 'article') printf(' data-permalink="%s"', JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catslug), true, -1)); ?>>
<?php if ($params->get('show_title')) : ?>
<header>
<?php if (!$this->print) : ?>
<?php if ($params->get('show_email_icon')) : ?>
<div class="icon email"><?php echo JHtml::_('icon.email', $this->item, $params); ?></div>
<?php endif; ?>
<?php if ($params->get('show_print_icon')) : ?>
<div class="icon print"><?php echo JHtml::_('icon.print_popup', $this->item, $params); ?></div>
<?php endif; ?>
<?php else : ?>
<div class="icon printscreen"><?php echo JHtml::_('icon.print_screen', $this->item, $params); ?></div>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<header class="clearfix">
<time datetime="<?php echo substr($this->item->created, 0,10); ?>" pubdate>
<span class="day"><?php echo JHTML::_('date',$this->item->created, JText::_('d')); ?></span>
<span class="month"><?php echo JHTML::_('date',$this->item->created, JText::_('M')); ?></span>
<span class="year"><?php echo JHTML::_('date',$this->item->created, JText::_('Y')); ?></span>
</time>
<?php endif; ?>
<h1 class="title"><?php echo $this->escape($this->item->title); ?></h1>
<?php if (($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category')) : ?>
<p class="meta">
<?php
if ($params->get('show_author') && !empty($this->item->author )) {
$author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author;
if (!empty($this->item->contactid) && $params->get('link_author') == true) {
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo JText::sprintf('<i class="icon-user"></i>');
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author));
} else {
echo JText::sprintf('<i class="icon-user"></i>');
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
}
}
if ($params->get('show_author') && !empty($this->item->author )) {
echo '. ';
}
if ($params->get('show_category')) {
echo JText::_('<i class="icon-folder-open-alt"></i>').' ';
echo JText::_('TPL_WARP_POSTED_IN').' ';
$title = $this->escape($this->item->category_title);
$url = ''.$title.'';
if ($params->get('link_category') AND $this->item->catslug) {
echo $url;
} else {
echo $title;
}
}
?>
</p>
<?php endif; ?>
</header>
<?php endif; ?>
<?php
if (!$params->get('show_intro')) {
echo $this->item->event->afterDisplayTitle;
}
echo $this->item->event->beforeDisplayContent;
if (isset ($this->item->toc)) {
echo $this->item->toc;
}
?>
<div class="content clearfix">
<?php
if ($params->get('access-view')) {
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='0')) OR ($params->get('urls_position')=='0' AND empty($urls->urls_position) ))
OR (empty($urls->urls_position) AND (!$params->get('urls_position')))) {
echo $this->loadTemplate('links');
}
if (isset($images->image_fulltext) and !empty($images->image_fulltext)) {
$imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext;
$class = (htmlspecialchars($imgfloat) != 'none') ? ' class="size-auto align-'.htmlspecialchars($imgfloat).'"' : ' class="size-auto"';
$title = ($images->image_fulltext_caption) ? ' title="'.htmlspecialchars($images->image_fulltext_caption).'"' : '';
echo '<img'.$class.$title.' src="'.htmlspecialchars($images->image_fulltext).'" alt="'.htmlspecialchars($images->image_fulltext_alt).'" />';
}
echo $this->item->text;
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='1')) OR ( $params->get('urls_position')=='1') )) {
echo $this->loadTemplate('links');
}
// optional teaser intro text for guests
} elseif ($params->get('show_noauth') == true AND $user->get('guest')) {
echo $this->item->introtext;
// optional link to let them register to see the whole article.
if ($params->get('show_readmore') && $this->item->fulltext != null) {
$link1 = JRoute::_('index.php?option=com_users&view=login');
$link = new JURI($link1);
echo '<p class="links">';
echo '<a href="'.$link.'">';
$attribs = json_decode($this->item->attribs);
if ($attribs->alternative_readmore == null) {
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
} elseif ($readmore = $this->item->alternative_readmore) {
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) {
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
}
} elseif ($params->get('show_readmore_title', 0) == 0) {
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
} else {
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
}
echo '</a></p>';
}
}
?>
</div>
<?php if ($canEdit) : ?>
<p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</article>
</div>
The only point that could reasonable be the social bar is this line:
<?php echo $this->item->event->afterDisplayContent; ?>
However it looks like a ore wider concept, since afterDisplayContent probably handles many things, and here is where I stop, I have no idea where to look for afterDisplayContent event definition, I guess that I should find an entry for social bar and copy/paste in the position that I want in my module.
Related
I've been racking my brain for weeks trying to remove this block of code, it's from paid memberships pro plugin.
I need to remove the below section as it produces the file fields on the user profile.
need to remove it and put it in a loop of its own and then print it, as I need it to be in a separate <section> from the rest of the fields that are in that original loop.
//----Trying to remove this piece of code----//
?>
<strong><?php echo $field[0]; ?></strong>
<div class="Test"><?php echo pmpromd_display_file_field($meta_field); ?></div>
<?php
//---This is the FullSnippet with the above code included----//
if(!empty($fields_array))
{
foreach($fields_array as $field)
{
if(empty($field[0]))
break;
// Fix for a trailing space in the 'fields' shortcode attribute.
if ( $field[0] === ' ' ) {
break;
}
$field_val = $field[1];
$meta_field = $pu->$field_val;
if(!empty($meta_field))
{
?>
<section class="pmpro_member_directory_<?php echo esc_attr($field[1]); ?>">
<?php
if(is_array($meta_field) && !empty($meta_field['filename']) )
{
//this is a file field
?>
<strong><?php echo $field[0]; ?></strong>
<div class="brendan"><?php echo pmpromd_display_file_field($meta_field); ?></div>
<?php
}elseif(is_array($meta_field)){
//this is a general array, check for Register Helper options first
if(!empty($rh_fields[$field[1]])) {
foreach($meta_field as $key => $value)
$meta_field[$key] = $rh_fields[$field[1]][$value];
}
?>
<strong><?php echo $field[0]; ?></strong>
<ul class="servicesList"><?php echo '<li>'.implode("</li>\n<li>",$meta_field).'</li>';?></ul>
<?php
}
elseif(!empty($rh_fields[$field[1]]) && is_array($rh_fields[$field[1]]) )
{
?>
<strong><?php echo $field[0]; ?></strong>
<?php echo $rh_fields[$field[1]][$meta_field]; ?>
<?php
}
else
{
if($field[1] == 'user_url')
{
?>
<?php echo $field[0]; ?>
<?php
}
else
{
?>
<strong><?php echo $field[0]; ?></strong>
<?php
$meta_field_embed = wp_oembed_get($meta_field);
if(!empty($meta_field_embed)){
echo $meta_field_embed;
}else{
echo make_clickable($meta_field);
}
?>
<?php
}
}
?>
</section>
<?php
}
}
}
?>
On a Joomla 3.4 site, articles display a "details" section like this by default :
Details
Written by John Doe
Published: 26 October 2015
What file to change, (and if possible how) to get the following result ?
By John Doe, on November 4, 2015
Edit after #itoctopus answer :
you will need to change the override file. You can do that by changing the
file /templates/your-template/html/com_content/article/default.php
Below is the content of the default.php.
What should be changed to achieve the result above ? I see nothing in this file related to the "details" section.
<?php
/**
* #package Joomla.Site
* #subpackage com_content
*
* #copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* #license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $params->get('access-edit');
$user = JFactory::getUser();
$info = $params->get('info_block_position', 0);
JHtml::_('behavior.caption');
?>
<div class="item-page<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="http://schema.org/Article">
<meta itemprop="inLanguage" content="<?php echo ($this->item->language === '*') ? JFactory::getConfig()->get('language') : $this->item->language; ?>" />
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1> <?php echo $this->escape($this->params->get('page_heading')); ?> </h1>
</div>
<?php endif;
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && $this->item->paginationrelative)
{
echo $this->item->pagination;
}
?>
<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') ); ?>
<?php if (!$useDefList && $this->print) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<div class="clearfix"> </div>
<?php endif; ?>
<?php if ($params->get('show_title') || $params->get('show_author')) : ?>
<div class="page-header">
<h2 itemprop="name">
<?php if ($params->get('show_title')) : ?>
<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h2>
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if (strtotime($this->item->publish_up) > strtotime(JFactory::getDate())) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate()) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if (!$this->print) : ?>
<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>
<?php else : ?>
<?php if ($useDefList) : ?>
<div id="pop-print" class="btn hidden-print">
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php if (!$params->get('show_intro')) : echo $this->item->event->afterDisplayTitle; endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '0')) || ($params->get('urls_position') == '0' && empty($urls->urls_position)))
|| (empty($urls->urls_position) && (!$params->get('urls_position')))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($params->get('access-view')):?>
<?php if (isset($images->image_fulltext) && !empty($images->image_fulltext)) : ?>
<?php $imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat); ?> item-image"> <img
<?php if ($images->image_fulltext_caption):
echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_fulltext_caption) . '"';
endif; ?>
src="<?php echo htmlspecialchars($images->image_fulltext); ?>" alt="<?php echo htmlspecialchars($images->image_fulltext_alt); ?>" itemprop="image"/> </div>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && !$this->item->paginationposition && !$this->item->paginationrelative):
echo $this->item->pagination;
endif;
?>
<?php if (isset ($this->item->toc)) :
echo $this->item->toc;
endif; ?>
<div itemprop="articleBody">
<?php echo $this->item->text; ?>
</div>
<?php if ($useDefList && ($info == 1 || $info == 2)) : ?>
<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && !$this->item->paginationrelative):
echo $this->item->pagination;
?>
<?php endif; ?>
<?php if (isset($urls) && ((!empty($urls->urls_position) && ($urls->urls_position == '1')) || ($params->get('urls_position') == '1'))) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php // Optional teaser intro text for guests ?>
<?php elseif ($params->get('show_noauth') == true && $user->get('guest')) : ?>
<?php echo $this->item->introtext; ?>
<?php // Optional link to let them register to see the whole article. ?>
<?php if ($params->get('show_readmore') && $this->item->fulltext != null) : ?>
<?php $menu = JFactory::getApplication()->getMenu(); ?>
<?php $active = $menu->getActive(); ?>
<?php $itemId = $active->id; ?>
<?php $link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false)); ?>
<?php $link->setVar('return', base64_encode(JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language), false))); ?>
<p class="readmore">
<a href="<?php echo $link; ?>" class="register">
<?php $attribs = json_decode($this->item->attribs); ?>
<?php
if ($attribs->alternative_readmore == null) :
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
elseif ($readmore = $this->item->alternative_readmore) :
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) :
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif;
elseif ($params->get('show_readmore_title', 0) == 0) :
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
else :
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
endif; ?>
</a>
</p>
<?php endif; ?>
<?php endif; ?>
<?php
if (!empty($this->item->pagination) && $this->item->pagination && $this->item->paginationposition && $this->item->paginationrelative) :
echo $this->item->pagination;
?>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>
You can do the above by CSS - but sometimes it's a bit tricky, so you will need to change the override file. You can do that by changing the file /templates/your-template/html/com_content/article/default.php
If you can't find that file (or that directory structure), then you will need to copy the this file components/com_content/views/article/tmpl/default.php to /templates/your-template/html/com_content/article/default.php (if there is a directory that doesn't exist then you will need to create it. for example, if you can only find the /templates/your-template/html under your templates folder the you will need to create the com_content folder under the html folder and then the article folder under the com_content folder).
You can then modify the default.php file to change the layout. Make sure you clear your Joomla cache to see your changes.
Using CSS and Language overrides worked out.
CSS : display:none to get rid of unwanted stuff and display:inline-block to put everything in a single line.
Changing Words in Joomla 3.4 backend :
from the control panel, click on Languages in the sidebar menu
Click 'overrides'
Choose the language in 'filter'
Click 'new'
in the form field next to 'search' button, type in the text you want to change
select the right string variable
Type in the wanted text
Save
done.
We are using Elision WP theme. We have a revolution slider on home pulled via shortcode in theme backend settings. We need to have static text on top of slides.
Revolution slider is set to 1100px x 680px and we want the "hero-text" div to be located on the lower left corner with a 20px from left and 50px from bottom. It also needs to be responsive.
Attached: layout image link, homepage.php code.
http://www.image-share.com/ijpg-2756-164.html
<?php
/*
Template Name: Homepage
*/
?>
<?php
global $wp_query;
$id = $wp_query->get_queried_object_id();
$sidebar = get_post_meta($id, "qode_show-sidebar", true);
if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
else { $paged = 1; }
if(get_post_meta($id, "qode_responsive-title-image", true) != ""){
$responsive_title_image = get_post_meta($id, "qode_responsive-title-image", true);
}else{
$responsive_title_image = $qode_options_elision['responsive_title_image'];
}
if(get_post_meta($id, "qode_fixed-title-image", true) != ""){
$fixed_title_image = get_post_meta($id, "qode_fixed-title-image", true);
}else{
$fixed_title_image = $qode_options_elision['fixed_title_image'];
}
if(get_post_meta($id, "qode_title-image", true) != ""){
$title_image = get_post_meta($id, "qode_title-image", true);
}else{
$title_image = $qode_options_elision['title_image'];
}
$title_image_height = "";
$title_image_width = "";
if(!empty($title_image)){
$title_image_url_obj = parse_url($title_image);
if (file_exists($_SERVER['DOCUMENT_ROOT'].$title_image_url_obj['path']))
list($title_image_width, $title_image_height, $title_image_type, $title_image_attr) = getimagesize($_SERVER['DOCUMENT_ROOT'].$title_image_url_obj['path']);
}
if(get_post_meta($id, "qode_title-height", true) != ""){
$title_height = get_post_meta($id, "qode_title-height", true);
}else{
$title_height = $qode_options_elision['title_height'];
}
$title_background_color = '';
if(get_post_meta($id, "qode_page-title-background-color", true) != ""){
$title_background_color = get_post_meta($id, "qode_page-title-background-color", true);
}else{
$title_background_color = $qode_options_elision['title_background_color'];
}
$show_title_image = true;
if(get_post_meta($id, "qode_show-page-title-image", true)) {
$show_title_image = false;
}
$qode_page_title_style = "standard";
if(get_post_meta($id, "qode_page_title_style", true) != ""){
$qode_page_title_style = get_post_meta($id, "qode_page_title_style", true);
}else{
if(isset($qode_options_elision['title_style'])) {
$qode_page_title_style = $qode_options_elision['title_style'];
} else {
$qode_page_title_style = "standard";
}
}
$height_class = "";
if($qode_page_title_style == "title_on_bottom") {
$height_class = " title_on_bottom";
}
$enable_page_comments = false;
if(get_post_meta($id, "qode_enable-page-comments", true)) {
$enable_page_comments = true;
}
?>
<?php get_header(); ?>
<?php if(get_post_meta($id, "qode_page_scroll_amount_for_sticky", true)) { ?>
<script>
var page_scroll_amount_for_sticky = <?php echo get_post_meta($id, "qode_page_scroll_amount_for_sticky", true); ?>;
</script>
<?php } ?>
<?php if(!get_post_meta($id, "qode_show-page-title", true)) { ?>
<div class="title<?php echo $height_class; ?> <?php if($responsive_title_image == 'no' && $title_image != "" && ($fixed_title_image == "yes" || $fixed_title_image == "yes_zoom") && $show_title_image == true){ echo 'has_fixed_background '; if($fixed_title_image == "yes_zoom"){ echo 'zoom_out '; } } if($responsive_title_image == 'no' && $title_image != "" && $fixed_title_image == "no" && $show_title_image == true){ echo 'has_background'; } if($responsive_title_image == 'yes' && $show_title_image == true){ echo 'with_image'; } ?>" style="<?php if($responsive_title_image == 'no' && $title_image != "" && $show_title_image == true){ if($title_image_width != ''){ echo 'background-size:'.$title_image_width.'px auto;'; } echo 'background-image:url('.$title_image.');'; } if($title_height != ''){ echo 'height:'.$title_height.'px;'; } if($title_background_color != ''){ echo 'background-color:'.$title_background_color.';'; } ?>">
<div class="image <?php if($responsive_title_image == 'yes' && $title_image != "" && $show_title_image == true){ echo "responive"; }else{ echo "not_responsive"; } ?>"><?php if($title_image != ""){ ?><img src="<?php echo $title_image; ?>" alt=" " /> <?php } ?></div>
<?php if(!get_post_meta($id, "qode_show-page-title-text", true)) { ?>
<div class="title_holder">
<div class="container">
<div class="container_inner clearfix">
<?php if($qode_page_title_style == "title_on_bottom") { ?>
<div class="title_on_bottom_wrap">
<div class="title_on_bottom_holder">
<div class="title_on_bottom_holder_inner" <?php if(get_post_meta($id, "qode_page_title_holder_color", true)) { ?> style="background-color:<?php echo get_post_meta($id, "qode_page_title_holder_color", true) ?>" <?php } ?>>
<h1<?php if(get_post_meta($id, "qode_page-title-color", true)) { ?> style="color:<?php echo get_post_meta($id, "qode_page-title-color", true) ?>" <?php } ?>><span><?php the_title(); ?></span></h1>
</div>
</div>
</div>
<?php } else { ?>
<h1<?php if(get_post_meta($id, "qode_page-title-color", true)) { ?> style="color:<?php echo get_post_meta($id, "qode_page-title-color", true) ?>" <?php } ?>><span><?php the_title(); ?></span></h1>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
<?php
$revslider = get_post_meta($id, "qode_revolution-slider", true);
if (!empty($revslider)){ ?>
<div class="q_slider"><div class="q_slider_inner">
<?php echo do_shortcode($revslider); ?>
</div></div>
<?php
}
?>
<div class="full_width">
<div class="full_width_inner">
<?php if(($sidebar == "default")||($sidebar == "")) : ?>
<?php if (have_posts()) :
while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php
$args_pages = array(
'before' => '<p class="single_links_pages">',
'after' => '</p>',
'pagelink' => '<span>%</span>'
);
wp_link_pages($args_pages); ?>
<?php
if($enable_page_comments){
?>
<div class="container">
<div class="container_inner">
<?php
comments_template('', true);
?>
</div>
</div>
<?php
}
?>
<?php endwhile; ?>
<?php endif; ?>
<?php elseif($sidebar == "1" || $sidebar == "2"): ?>
<?php if($sidebar == "1") : ?>
<div class="two_columns_66_33 clearfix grid2">
<div class="column1">
<?php elseif($sidebar == "2") : ?>
<div class="two_columns_75_25 clearfix grid2">
<div class="column1">
<?php endif; ?>
<?php if (have_posts()) :
while (have_posts()) : the_post(); ?>
<div class="column_inner">
<?php the_content(); ?>
<?php
$args_pages = array(
'before' => '<p class="single_links_pages">',
'after' => '</p>',
'pagelink' => '<span>%</span>'
);
wp_link_pages($args_pages); ?>
<?php
if($enable_page_comments){
?>
<div class="container">
<div class="container_inner">
<?php
comments_template('', true);
?>
</div>
</div>
<?php
}
?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="column2"><?php get_sidebar();?></div>
</div>
<?php elseif($sidebar == "3" || $sidebar == "4"): ?>
<?php if($sidebar == "3") : ?>
<div class="two_columns_33_66 clearfix grid2">
<div class="column1"><?php get_sidebar();?></div>
<div class="column2">
<?php elseif($sidebar == "4") : ?>
<div class="two_columns_25_75 clearfix grid2">
<div class="column1"><?php get_sidebar();?></div>
<div class="column2">
<?php endif; ?>
<?php if (have_posts()) :
while (have_posts()) : the_post(); ?>
<div class="column_inner">
<?php the_content(); ?>
<?php
$args_pages = array(
'before' => '<p class="single_links_pages">',
'after' => '</p>',
'pagelink' => '<span>%</span>'
);
wp_link_pages($args_pages); ?>
<?php
if($enable_page_comments){
?>
<div class="container">
<div class="container_inner">
<?php
comments_template('', true);
?>
</div>
</div>
<?php
}
?>
</div>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>
I'm not sure how you're planning to get your static headline onto the page. You could hard code it in there as I am about to show you below or you could create a custom field. If you decide to take that route, I find that Advanced Custom Fields is really easy to use.
<?php
$revslider = get_post_meta($id, "qode_revolution-slider", true);
if (!empty($revslider)){ ?>
<div class="q_slider"><div class="q_slider_inner">
<h1 class="static-headline">Your awesome text goes here</h1>
<?php echo do_shortcode($revslider); ?>
</div></div>
<?php
Add the following CSS to your site to position it in the correct place:
.q_slider_inner { position: relative; }
.static-headline {
position: absolute;
bottom: 5%;
left: 2%;
color: #fff;
z-index: 21;
}
You'll need to play around with the percentages to get the headline exactly where you need it but I recommend using % over px values since you want this to be responsive.
I hope this helps.
I have a code that is for a gallery. The images in this gallery opens in a fancybox. I don't want to link this images to a fancybox but i want link this images to one specific page. This is the code that must be customized:
<?php
global $sr_prefix;
$gallery = get_post_meta($post->ID, $sr_prefix.'_medias', true);
$postid = $post->ID;
$maintitle = 'h2'; $subtitle = 'h5';
if (get_option($sr_prefix.'_blogentrieslayout') == 'masonry' || get_option($sr_prefix.'_blogentrieslayout') == 'bloglist') { $maintitle = 'h4'; $subtitle = 'h6'; }
if( empty($gallery) || get_option($sr_prefix.'_blogentriesdisplay') == 'featuredimage' || get_option($sr_prefix.'_blogpostgallerydisplay') == "list" ) {
?>
<?php if(has_post_thumbnail()) { ?>
<div class="entry-thumb entry-media blog-media">
<div class="imgoverlay">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('single-blog-image'); ?>
<div class="overlay"><span class="overlaycolor"></span><span class="overlayinfo">
<?php echo '<'.$maintitle.'>'; ?><strong><?php the_title(); ?></strong><?php echo '</'.$maintitle.'>'; ?>
<?php if (!get_option($sr_prefix.'_blogpostsdisabledate')) { ?>
<?php echo '<'.$subtitle.'>'; ?><?php the_time(get_option('date_format')); ?><?php echo '</'.$subtitle.'>'; ?>
<?php } ?>
</span></div>
</a>
</div>
</div> <!-- END .entry-media -->
<?php } ?>
<?php
} else {
$medias = explode('|||', $gallery);
$output_medias = '';
foreach ($medias as $media) {
$object = explode('~~', $media);
$type = $object[0];
$val = $object[1];
$output_medias .= "<li>";
if ($type == 'image') {
$image = wp_get_attachment_image_src($val, 'single-blog-image'); $image = $image[0];
$fancyimage = wp_get_attachment_image_src($val, 'full'); $fancyimage = $fancyimage[0];
$thisimage = '<img src="'.$image.'" alt="'.get_the_title($image[1]).'"/>';
if(get_option($sr_prefix.'_blogpostsdisablefancybox') !== "on") {
$output_medias .= '<div class="imgoverlay">'.$thisimage.'<div class="overlay"><span class="overlaycolor"></span></div></div>';
} else {
$output_medias .= $thisimage;
}
} else {
$output_medias .= '<div class="embeddedvideo">'.$val.'</div>';
}
$output_medias .= "</li>";
}
?>
<?php if(get_option($sr_prefix.'_blogpostgallerydisplay') !== "list" ) { ?>
<div class="entry-media blog-media">
<div id="slider-<?php echo $postid; ?>" class="flexslider-container post-slider">
<div class="flexslider">
<ul class="slides">
<?php echo $output_medias; ?>
</ul>
</div>
</div>
</div> <!-- END .entry-media -->
<?php } else { ?>
<div class="entry-media blog-media">
<?php the_post_thumbnail('single-blog-image'); ?>
</div> <!-- END .entry-media -->
<?php } ?>
<?php } ?>
Seems like you are using Wordpress.
First of all you have to look at this part
if ($type == 'image') {
$image = wp_get_attachment_image_src($val, 'single-blog-image'); $image = $image[0];
$fancyimage = wp_get_attachment_image_src($val, 'full'); $fancyimage = $fancyimage[0];
$thisimage = '<img src="'.$image.'" alt="'.get_the_title($image[1]).'"/>';
if(get_option($sr_prefix.'_blogpostsdisablefancybox') !== "on") {
$output_medias .= '<div class="imgoverlay">'.$thisimage.'<div class="overlay"><span class="overlaycolor"></span></div></div>';
You have if(get_option($sr_prefix.'_blogpostsdisablefancybox') !== "on") option, which i suppose can disable fancybox, maybe it's somewhere in WP admin panel.
Anyway, if I remember correctly, fancybox links it's events to particular class, in this case it's openfancybox class. You can remove this class and disable fancybox.
$output_medias .=
'<div class="imgoverlay">
<a href="'.$fancyimage.'" class="openfancybox" rel="gallery'.get_the_ID().'" title="'.get_the_title($image[1]).'">'.$thisimage.'
<div class="overlay"><span class="overlaycolor">
</span>
</div>
</a>
</div>';
Then you can just change $fancyimage variable to you desired URL.
This is a very difficult question to ask but, lets try. I am using this module for joomla i need tocreate an overide for it so that it takes the first result of
<?php foreach( $pages as $key => $list ): ?>
and places it in its own div and carries on with the statement. Please ask if any other information is needed here's the entire code for the override:
<?php
/**
* #package mod_bt_contentslider - BT ContentSlider Module
* #version 1.4
* #created Oct 2011
* #author BowThemes
* #email support#bowthems.com
* #website http://bowthemes.com
* #support Forum - http://bowthemes.com/forum/
* #copyright Copyright (C) 2012 Bowthemes. All rights reserved.
* #license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
if($modal){JHTML::_('behavior.modal');}
$document = JFactory::getDocument();
if(count($list)>0){?>
<div id="btcontentslider<?php echo $module->id; ?>" style="display:none;" class="span4 bt-cs<?php echo $moduleclass_sfx? ' bt-cs'.$params->get('moduleclass_sfx'):'';?>">
<!--CONTENT-->
<div class="slides_container" style="width:<?php echo $moduleWidth.";".$add_style;?>">
<?php foreach( $pages as $key => $list ): ?>
<div class="slide" style="width:100%;">
<?php foreach( $list as $i => $row ): ?>
<ul class="bt-row <?php if($i==0) echo 'bt-row-first'; else if($i==count($list)-1) echo 'bt-row-last' ?>" style="width:100%" >
<li class="bt-inner">
<?php if( $row->thumbnail && $align_image != "center"): ?>
<a target="<?php echo $openTarget; ?>" class="bt-image-link<?php echo $modal? ' modal':''?>" title="<?php echo $row->title;?>" href="<?php echo $modal?$row->mainImage:$row->link;?>">
<img <?php echo $imgClass ?> src="<?php echo $row->thumbnail; ?>" alt="<?php echo $row->title?>" style="width:<?php echo $thumbWidth ;?>px; float:<?php echo $align_image;?>;margin-<?php echo $align_image=="left"? "right":"left";?>:5px" title="<?php echo $row->title?>" />
</a>
<?php endif; ?>
<?php if( $showTitle ): ?>
<a class="bt-title" target="<?php echo $openTarget; ?>"
title="<?php echo $row->title; ?>"
href="<?php echo $row->link;?>"> <?php echo $row->title_cut; ?> </a><br />
<?php endif; ?>
<?php if( $row->thumbnail && $align_image == "center" ): ?>
<div class="bt-center">
<a target="<?php echo $openTarget; ?>"
class="bt-image-link<?php echo $modal? ' modal':''?>"
title="<?php echo $row->title;?>" href="<?php echo $modal?$row->mainImage:$row->link;?>">
<img <?php echo $imgClass ?> src="<?php echo $row->thumbnail; ?>" alt="<?php echo $row->title?>" style="width:<?php echo $thumbWidth ;?>px;" title="<?php echo $row->title?>" />
</a>
</div>
<?php endif ; ?>
<?php if( $show_intro ): ?>
<div class="bt-introtext">
<?php echo $row->description; ?>
</div>
<?php endif; ?>
<?php if( $showReadmore ) : ?>
<p class="readmore">
<a target="<?php echo $openTarget; ?>"
title="<?php echo $row->title;?>"
href="<?php echo $row->link;?>"> <?php echo JText::_('READ_MORE');?>
</a>
</p>
<?php endif; ?>
</li>
<!--end bt-inner -->
</ul>
<!--end bt-row -->
<!--CONTENT-->
<?php endforeach; ?>
<div style="clear: both;"></div>
</div>
<!--end bt-main-item page -->
<?php endforeach; ?>
</div>
<?php if( $next_back && $totalPages > 1 ) : ?>
<a class="prev" href="#"></a><a class="next" href="#"></a>
<?php endif; ?>
</div>
<!--end bt-container -->
<div style="clear: both;"></div>
<script type="text/javascript">
if(typeof(btcModuleIds)=='undefined'){var btcModuleIds = new Array();var btcModuleOpts = new Array();}
btcModuleIds.push(<?php echo $module->id; ?>);
btcModuleOpts.push({
slideEasing : '<?php echo $slideEasing; ?>',
fadeEasing : '<?php echo $slideEasing; ?>',
effect: '<?php echo $effect; ?>',
preloadImage: '<?php echo $preloadImg; ?>',
generatePagination: <?php echo $paging ?>,
play: <?php echo $play; ?>,
hoverPause: <?php echo $hoverPause; ?>,
slideSpeed : <?php echo $duration; ?>,
autoHeight:<?php echo $autoHeight ?>,
fadeSpeed : <?php echo $fadeSpeed ?>,
equalHeight:<?php echo $equalHeight; ?>,
width: <?php echo $moduleWidth=='auto'? "'auto'":$params->get( 'module_width', 0 ); ?>,
height: <?php echo $moduleHeight=='auto'? "'auto'":$params->get( 'module_height', 0 ); ?>,
pause: 100,
preload: true,
paginationClass: '<?php echo $butlet==1 ? 'bt_handles': 'bt_handles_num' ?>',
generateNextPrev:false,
prependPagination:true,
touchScreen:<?php echo $touchScreen ?>
});
</script>
<?php
// set position for bullet
if($butlet) {
$nav_top = (-1)*(int)$params->get( 'navigation_top', 0 );
$nav_right = (-1)*(int)$params->get( 'navigation_right', 0 )+5;
if(trim($params->get('content_title'))) $nav_top += 13;
$document->addStyleDeclaration(
$modid . ' ' . ($butlet == 1 ? '.bt_handles' : '.bt_handles_num') . '{'.
'bottom: ' . '5% !important;'.
'right: ' . '50% !important'.
'}'
);
}
// set responsive for mobile device
if($moduleWidth=='auto'){
$document->addStyleDeclaration(
'
#media screen and (max-width: 480px){.bt-cs .bt-row{width:100%!important;}}'
);
}
}
else
{
echo '<div>No result...</div>';
} ?>
Any Help Greatly apreciated.
you can do something like this. basicly, set a boolean to only do something different to the first item:
<?php $first = true; ?>
<?php foreach( $pages as $key => $list ): ?>
<?php
if($first) {
/* put this $list in its own div or whatever you need to do */
$first = false;
} else {
... //the default operation/code
?>
...
<?php } ?>
<?php endforeach; ?>
Complete Edit:
Use a counter to know which iteration it is:
<?php $c = 0; // initialize counter
foreach( $pages as $key => $list ):
if ($c++ == 0):
?>
this section will only run for the first element.
<?php endif;?>