Jump to content

Archived

This topic is now archived and is closed to further replies.

glennyboy

Hooks for masonic section custom HTML PHP Shortcodes

Recommended Posts

glennyboy
 

Hi

 

Strange I thought I had already asked this, but apparently it isn't showing now.... 

 

I need to extend Masonic section and others with HTML / PHP & Shortcodes. In particular I want to show Custom Fields outside the loop with code I already know works. Is there a hook for Masonic and other sections to extend the available fields.

 

As a side note a custom field as per simon's PLNextBox would be wonderful.

 

Thanks

 

Glennyboy

Share this post


Link to post
Share on other sites
greenfly

Hello @glennyboy 

 

I will ask the Dev's about this for you and update you ASAP


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
glennyboy
 

Any update please?

Share this post


Link to post
Share on other sites
Danny

When you say extend the available fields are you referring to the sections option fields ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
glennyboy
 

i want to hook some php into the section and these are Wordpress Custom Fields / Custom Meta

Share this post


Link to post
Share on other sites
Danny

DMS includes the following:

 

pagelines_before_X
pagelines_after_X
pagelines_inside_top_X
pagelines_inside_bottom_X
 
You replace X with the sections folder name. Lets say for example, you want to include <h1>Hello World!</h1> Above the Masthead section, then you would use the following:
 
add_action('pagelines_inside_top_masthead', 'blahblah');
    function blahblah() {
    echo '<h1>Hello World!</h1>';
}
 
However, this will do so for all sections, so if you wish to target a specific section, you will want to use some WordPress conditionals.
 

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
glennyboy
 

So for php after Masonic Title for example?

Share this post


Link to post
Share on other sites
Danny

What do you mean ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
glennyboy
 

what is the specific hook for php content below the title in masonic?

Share this post


Link to post
Share on other sites
Danny

There isn't one, no theme includes hooks that specific. If you want to add include PHP to such as specific place, then I would recommend creating a child of the section you wish to include this code and add it to the section.php file yourself.

 

Ill speak to our developers, there may well be a filter that I am not aware of, as soon as I have more information, I will respond. However, for me personally creating a child section is the best course of action and safest.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
glennyboy
 

I didn't realise you can create a section child?

Share this post


Link to post
Share on other sites
glennyboy
 

Man why didn't I see that before - no specific need for hooks if you can just plugin to an existing section (of course as long as the section doesn't update out of recognition to the child section).For the latter reason if there is a hook to make 'incremental' changes that would be useful.

 

I have child theme, but thanks for the link.

Share this post


Link to post
Share on other sites
Danny

If you place a sections folder inside a child themes folder, it will override the section from the core folder in this case DMS. So you will never have to worry about updates to DMS wiping your settings. Unless the section receives an update itself.

 

In regards to hooks for specific section elements, I honestly don't believe that will ever see the light of day. However, I will bring it to our developers attention for you.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
glennyboy
 

That's what i'm saying - if the section changes drastically then the child becomes outdated... 

Share this post


Link to post
Share on other sites
Danny

Yeah, but you can create a section based off that section, if that makes sense.

For example:

 

If you copy the Masthead sections folder from the DMS sections folder to your child themes folder and change:

 

The folder name from masthead to dannys-masthead and then in the sections.php file change:

 

<?php
/*
Section: Dannys Masthead
Author: PageLines
Description: A responsive full width splash and text area. Great for getting big ideas across quickly.
Class Name: DannysMasthead
Edition: pro
Workswith: templates, main, header, morefoot
Filter: component
Loading: active
*/

 

and then in the sections.php file, you change all instances of the class name to DannysMasthead, you will have two instances of the Masthead section when you reload the Sections. You will the core Masthead section and Danny Masthead section.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • stijnxo
      By stijnxo+
      The Filtering of categories in the Masonic Gallery refreshes back to ALL categories when the DMS Revslider loads a new image?
      Anybody any idea? See Artists Category refreshes back to ALL when the DMS Revslider with images on the top loads a news image on http://www.18hrsfestival.nl/
    • Susan
      By Susan+
      I have three items in my Masonic section. I would like them to center on the page. Here is the page on my staging site. What is the CSS code to do this? I don't see another option to handle this.
      Thank you.
       
       
    • Susan
      By Susan+
      Please tell me how to remove the date on hover from the Masonic section. The dummy for this page is here.
      An older post here showed the following for it (below) but it does not work (anymore?).
      #site .pl-center-cell .metabar { display: none; } Thank you.
       
       
    • MissT
      By MissT+
      Hi there, the Filter By option within the Masonic section isn't working when a custom post type and custom category is selected.  If you swap to normal posts and categories then it works but sadly not with custom post types and custom categories.
      All posts are shown but when you click on the categories all posts disappear even though posts do have these categories. When you click All all the posts come back. I've tried this on two different websites with the same result.
      Many thanks in advance.
    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
×