Site logo

Archived topic

GP Hooks

24 replies · Started by Nicholas Harvey on December 21, 2014

Viewing posts 1–15 of 25

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,
Nick

Hi 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 :)

On 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.

patron_magazine

<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>

Hi 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 :)

Thank 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!

Hi there,

Try this:

<?php if ( is_front_page() ) : ?>
      <?php echo do_shortcode("[metaslider id=170]"); ?>
<?php endif; ?>

I 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; ?>

I 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.

Can you try it in the After Header area?

Unfortunately 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">
patron_magazine


</div>

I 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

So 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.

I 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 :)

Thank you so much Tom, that did the trick. You are the best!

This archived topic is closed to new replies.