So far I have the following header on my site:
Right now, when you scroll down the page, the sticky header is the LOGO, Phone numnber and the Request service button in red. How could I change this to use the Services menu below to be my sticky header instead?
I checked the code of the Header.php and found the following lines:
// Sticky header
if(isset($theme_options['enable_sticky_header']) && $theme_options['enable_sticky_header']) {
$header_add_class = ' class="'.esc_attr('sticky-header main-header').'"';
} else {
$header_add_class = ' class="'.esc_attr('main-header').'"';
}
?>
<header<?php echo $header_add_class; ?>>
<div class="container<?php echo esc_attr($header_container_add_class); ?>">
<div class="row">
<div class="col-md-12">
<div class="header-left logo">
<?php
// Center logo
if(isset($theme_options['header_logo_position']) && $theme_options['header_logo_position'] == 'center'): ?>
<?php magnium_header_center_show(); ?>
<?php else: ?>
<?php magnium_header_left_show(); ?>
<?php endif;
// Center logo END
?>
</div>
<div class="header-center">
<?php
// Center logo
if(isset($theme_options['header_logo_position']) && $theme_options['header_logo_position'] == 'center'):
?>
<?php magnium_header_left_show(); ?>
<?php else: ?>
<?php magnium_header_center_show(); ?>
<?php
endif;
// Center logo END
?>
</div>
<div class="header-right">
<?php magnium_header_right_show(); ?>
</div>
</div>
</div>
</div>
<?php magnium_menu_below_header_show(); ?>
</header>
I guess this line magnium_menu_below_header_show() is responsible for displaying the menu, but I really do not know where to search it. Although I looked in functions.php, I could not find it.
I know I could use a plugin, but I just do not want to always rely on plugins if I can make it by myself.
I'm new in programming zend and socialengine. I have default.tpl layouts like the following:
<body id="global_page_<?php echo $identity ?>">
<div id="global_header">
<?php echo $this->content('header') ?>
</div>
<div id='global_wrapper'>
<div id='global_content'>
<div class="new class contain widget">
</div>
<?php //echo $this->content('global-user', 'before') ?>
<?php echo $this->layout()->content ?>
<?php //echo $this->content('global-user', 'after') ?>
</div>
</div>
<div id="global_footer">
<?php echo $this->content('footer') ?>
</div>
<div id="janrainEngageShare" style="display:none">Share</div>
</body>
I want to add/call widget and place it inside <div class="new class contain widget"> </div> tag. For example, I want to add widget menu main and search widget from Core Module inside this html tag, How can I achieve this? Need your help.
It is quite simple.
Use the following code, replacing the core.menu-main with name of your widget:
<div class="new class contain widget">
<?php echo $this->content()->renderWidget("core.menu-main"); ?>
</div>
So I've got a Magento install, with Fishpig Wordpress Integration and the ACF plugin to pull in meta values. I'm also using the repeater field here which pulls in the metadata as an array (as I understand it). The Fishpig documentation is non- existent so alot of this is guess work really but here's my code:
<?php
/**
* #category Fishpig
* #package Fishpig_Wordpress
* #license http://fishpig.co.uk/license.txt
* #author Ben Tideswell <help#fishpig.co.uk>
*/
?>
<?php $page = $this->getPage() ?>
<?php if ($page): ?>
<?php $helper = $this->helper('wordpress') ?>
<?php $author = $page->getAuthor() ?>
<div class="page-title">
<h1><?php echo $this->escapeHtml($page->getPostTitle()); ?></h1>
</div>
<?php
$lookbooks = $page->getMetaValue('lookbooks');
if($lookbooks):
foreach ($lookbooks as $lookbook) {
$title = $lookbook['title'];
$content = $lookbook['content'];
$images = array($lookbook['images']);?>
<h2><?php echo $title;?></h2>
<div class="connected-carousels">
<div class="stage">
<ul>
<?php foreach($images as $image) { ?>
<li>
<img src="<?php echo $image['image'];?>" alt="<?php echo $image['alt'];?>" />
</li>
<?php } ?>
</ul>
‹
<a href="#" class="next next-stage" >›</a>
</div>
<div class="navigation">
‹
<a href="#" class="next next-navigation" >›</a>
<div class="carousel carousel-navigation">
</div>
</div>
</div>
<?php echo $content ; ?>
<?php }
else : ?>
<div class="post-view">
<div class="entry std">
<?php if ($page->isViewableForVisitor()): ?>
<?php if ($featuredImage = $page->getFeaturedImage()): ?>
<div class="featured-image left"><img src="<?php echo $featuredImage->getAvailableImage() ?>" alt=""/></div>
<?php endif; ?>
<?php echo $page->getPostContent() ?>
<br style="clear:both;"/>
<?php else: ?>
<?php echo $this->getPasswordProtectHtml() ?>
<?php endif; ?>
</div>
</div>
<?php endif;?>
<?php endif; ?>
What I'm trying to do is use the repeater field to make a carousel using jcarousel, I'm fine with my jquery but there's some sort of PHP error here preventing the page from loading.
Here's my ACF structure with the labels:
lookbook (repeater)
--title
--content
--images (repeater)
----image
----alt
I can't see any php errors in the servers error log, nor is the page displaying any errors. It's just not echoing the $image array although it is repeating the loop the right amount of times.
Maybe I'm miles away, maybe I'm nearly there I just can't see anything wrong with it.
Thanks in advance
There is an issue in version 1.2.1.0 of the ACF extension that breaks repeater fields that are embedded inside a repeater field. I have just released version 1.2.2.0 that fixes this issue and allows you to use repeater fields inside other repeater fields.
I'm trying to do something, which I feel really dumb for, and I'm sure is very simple. However, I'm having such a difficult time trying to find any clear examples on the web. I've tried modifying divs and css, but to no avail.
Can anyone give me a clear example of how to have, for instance 2 or more form fields on the same line in Cactive form for creating a new model, as opposed to the default one on each line.
Any help would be greatly appreciated!!
I've attempted form = 'wide form'
but I get strange formatting that ends up like in the example here:
http://imgur.com/E5VVs
Suppose this is your form (taken from Yii documentation)
<?php $form = $this->beginWidget('CActiveForm', array(
'id'=>'user-form',
'enableAjaxValidation'=>true,
'enableClientValidation'=>true,
'focus'=>array($model,'firstName'),
)); ?>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<?php echo $form->labelEx($model,'firstName'); ?>
<?php echo $form->textField($model,'firstName'); ?>
<?php echo $form->error($model,'firstName'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'lastName'); ?>
<?php echo $form->textField($model,'lastName'); ?>
<?php echo $form->error($model,'lastName'); ?>
</div>
<?php $this->endWidget(); ?>
You could use blueprint default built depending on the width of your page to split it into 2 columns like
<?php $form = $this->beginWidget('CActiveForm', array(
'id'=>'user-form',
'enableAjaxValidation'=>true,
'enableClientValidation'=>true,
'focus'=>array($model,'firstName'),
)); ?>
<?php echo $form->errorSummary($model); ?>
<div class="row">
<div class="span-8">
<?php echo $form->labelEx($model,'firstName'); ?>
<?php echo $form->textField($model,'firstName'); ?>
<?php echo $form->error($model,'firstName'); ?>
</div>
<div class="span-8 last">
<?php echo $form->labelEx($model,'lastName'); ?>
<?php echo $form->textField($model,'lastName'); ?>
<?php echo $form->error($model,'lastName'); ?>
</div>
</div>
<?php $this->endWidget(); ?>
you can get your self familiar with blueprint css or general css rules in tons of places on the web. sorry I cant help more without seeing your code. if there is already a built in magical solution for this perhaps someone else knows it?
For the below example:
<div class="row">
<?php echo $form->labelEx($model,'firstName'); ?>
<?php echo $form->textField($model,'firstName'); ?>
<?php echo $form->error($model,'firstName'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'lastName'); ?>
<?php echo $form->textField($model,'lastName'); ?>
<?php echo $form->error($model,'lastName'); ?>
</div>
All you need to do is set change a little css
.row {
width:200px; /* or whatever you prefer */
float:left;
}
Remember to clear:left after your finished floating elements or other elements may wrap oddly.
You can also use:
.row {
width:200px; /* or whatever you prefer */
display:inline-block;
}
This does something different but may be a better option for you. Your rows will stay in the dom structure unline when floating, but it may have unintended results. Try both and see what you come up with.
Just change the CSS class to "column" instead of "row" of the div prior to ones you wish to put on the same row.
Example:
To change the following four row divs ...
<div class="row"> ... </div>
<div class="row"> ... </div>
<div class="row"> ... </div>
<div class="row"> ... </div>
into three divs that sits side-by-side, and the last div on a new row, just do the following:
<div class="column"> ... </div>
<div class="column"> ... </div>
<div class="row"> ... </div>
<div class="row"> ... </div>
Or am I completely misunderstanding the question...
I have a div that looks like this:
<div id="restinfoinn">
<div id="resthead">Purpose</div>
<div id="restcontstitle2"><?php echo $row_pages_here['purpose']; ?></div>
</div>
I want it to be omitted if the value of purpose is empty/null. How can I do this?
<?php if (!empty($row_pages_here['purpose'])) : ?>
<div id="restinfoinn">
<div id="resthead">Purpose</div>
<div id="restcontstitle2"><?php echo $row_pages_here['purpose']; ?></div>
</div>
<?php endif; ?>
But i think it would be better to print the empty div and deal with the design in CSS
This is really basic. You just need to do an IF check on top.
<?php if (!empty($row_pages_here['purpose'])) : ?>
<div id="restinfoinn">
<div id="resthead">Purpose</div>
<div id="restcontstitle2"><?php echo $row_pages_here['purpose']; ?></div>
</div>
<?php endif;?>
Have a look at alternative control syntax and empty