- This topic has 24 replies, 5 voices, and was last updated 6 years, 11 months ago by Tom.
-
AuthorPosts
-
December 21, 2014 at 4:35 pm #56796Nicholas Harvey
Hello!
I am working on my website, and right above the footer, I want to have some text. However, I don’t know which hook to use. Can you explain all of the hooks?
Thanks,
NickDecember 21, 2014 at 9:07 pm #56897TomLead DeveloperLead DeveloperHi Nick,
You’re probably looking for the “Before Footer” hook.
You may want to wrap your content in a container as well, like this:
<div class="grid-container grid-parent"> YOUR CONTENT IN HERE </div>
Let me know π
December 25, 2014 at 5:45 am #57892JosephOn the Hooks issue I placed the code below with a secondary menu in the Inside Content Container section. The menu is contained inside the container and I want to extend the menu full width but it’s not letting me. If I add a width to it, it messes with the responsive, of course because I added width. Then the last menu item “RESOURCES” is not showing the drop down menu.
Can you assist, please?
Thank you.<nav id=”secondary-navigation” class=”secondary-navigation” role=”navigation” itemscope=”itemscope” itemtype=”http://schema.org/SiteNavigationElement”>
<div class=”inside-navigation grid-container grid-parent”>
<h3 class=”menu-toggle”>Menu1</h3>
<div class=”screen-reader-text skip-link”>
Skip to content
</div>
<div class=”main-nav”>
<ul id=”menu-menu-1″ class=”secondary-menu sf-menu sf-js-enabled sf-arrows”>
<li id=”menu-item-368″ class=”menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-2 current_page_item menu-item-368″>
HOME<li id=”menu-item-338″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-338″>
CONTEMPORARIES<li id=”menu-item-20″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-20″>
CULTURED<li id=”menu-item-19″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-19″>
SPACE<li id=”menu-item-16″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-16″>
NOTED<li id=”menu-item-21″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-21″>
THERE<li id=”menu-item-364″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-364″>
RESOURCES
<ul class=”sub-menu” style=”display: none;”>
<li id=”menu-item-365″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-365″>
Performing Arts<li id=”menu-item-366″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-366″>
Galleries<li id=”menu-item-367″ class=”menu-item menu-item-type-custom menu-item-object-custom menu-item-367″>
Visual Arts</div>
</div>
</nav>December 26, 2014 at 11:13 am #58077TomLead DeveloperLead DeveloperHi there,
Try adding it without the container code I provided above – just add the code you included above into the hook.
Let me know if that works π
December 27, 2014 at 9:31 pm #58505JosephThank you, one more question.
Since I am using a category page as my home page I needed a slider on top so I added Meta-Slider to the GP Hooks, It works fine but it’s showing on all pages. Here is the PHP code for the slider, how can I only make the slider show in one category (ID 10)<?php
echo do_shortcode(“[metaslider id=170]”);
?>Sorry for the time but really need some help.
Thanks!December 28, 2014 at 1:28 am #58525TomLead DeveloperLead DeveloperHi there,
Try this:
<?php if ( is_front_page() ) : ?> <?php echo do_shortcode("[metaslider id=170]"); ?> <?php endif; ?>
December 28, 2014 at 1:49 am #58526JosephI added this and the slider disappeared. The front page is actually a category page (?cat=10)
<?php if ( is_front_page(?cat=10) ) : ?>
<?php echo do_shortcode(“[metaslider id=170]”); ?>
<?php endif; ?>If I add this, the slider stays and broken code appears on the top and bottom of the slider.
<?php if ( is_front_page() ) : ?>
<?php echo do_shortcode(“[metaslider id=170]”); ?>
<?php endif; ?>December 28, 2014 at 10:14 am #58676TomLead DeveloperLead DeveloperWe an use “is_category” in that case.
http://codex.wordpress.org/Conditional_Tags#A_Category_Page
So it would be:
<?php if ( is_category( '10' ) ) : ?> <?php echo do_shortcode("[metaslider id=170]"); ?> <?php endif; ?>
Be sure to check the “Execute PHP” checkbox.
December 30, 2014 at 7:14 pm #59934JosephI used the PHP code you provided in the BEFORE CONTENT in GP Hooks and it completely took off the slider. The Execute PHP is checked.
Here is the page and trying to add the slider under the Secondary Menu and above the first post.<?php if ( is_category( ’10’ ) ) : ?>
<?php echo do_shortcode(“[metaslider id=170]”); ?>
<?php endif; ?>http://provinciawebdesign.com/patronmag/?cat=10
Thank you for your time.
December 31, 2014 at 12:00 am #59983TomLead DeveloperLead DeveloperCan you try it in the After Header area?
December 31, 2014 at 1:25 am #59999JosephUnfortunately in After the Header area that’s where I have the logo/Subscribe Today/Digital Edition images. The secondary menu is blow that and then the slider should come next. But I just cant get it to show on that one category page.
AFTER THE HEADER:
<div style=”margin-top:-219px;margin-bottom:130px;margin-left:10%;” class=”grid-container grid-parent”>
</div>December 31, 2014 at 1:33 am #60000JosephI mean, if I set the PHP INSIDE CONTENT CONTAINER, it appears But on all pages. There is some broken code as shown below the slider. So this is where I want to be but only on the Home page which is a catefory (10) page and using the code provided.
<?php if ( is_category( ’10’ ) ) : ?>
<?php echo do_shortcode(“[metaslider id=170]”); ?>
<?php endif; ?>Here is the page view: http://provinciawebdesign.com/patronmag/?cat=10
December 31, 2014 at 12:00 pm #60232TomLead DeveloperLead DeveloperSo I’m seeing the Meta Slider currently, but it’s showing on all pages, not just that category?
Not sure what could be causing this – it’s just simple if conditionals.
It might help if you send me a temporary admin login to support@generatepress.com so I can see if I can spot the issue.
January 1, 2015 at 10:39 am #60535TomLead DeveloperLead DeveloperI just took a look and added the is_category( ’10’ ) part to the hook, and it seems to have worked. The slider is no longer on every page, but it is on that category page.
Let me know π
January 1, 2015 at 10:43 pm #60721JosephThank you so much Tom, that did the trick. You are the best!
-
AuthorPosts
- You must be logged in to reply to this topic.