Jump to content


Photo

PHP Function

php function genesis framework wordpress

  • Please log in to reply
4 replies to this topic

#1 kwmlr439

kwmlr439

    Member

  • Members
  • PipPip
  • 14 posts

Posted 09 May 2014 - 06:42 AM

PHP Warriors, Please help :)

I am trying to write a function in the genesis framwork that would allow me to add before_content_sidebar_wrap only on page_blog.php for my slider but can't seem to get it to work! I notice that the wrap and hook are added successefully but they display in every page instead of the blog only. Any help would be greatly appreciated. Here is my function
 

add_action('genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap');

    if ( ! ( is_page_template( ‚page_blog.php‚ ) ) )
return;


and here is my website I am displaying the slider on. It should be only on the blog page; mainlinerealtors.com/blog/

Thanks a lot,


Edited by kwmlr439, 09 May 2014 - 06:43 AM.


#2 Clarkey

Clarkey

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • LocationBedfordshire, UK
  • Age:20

Posted 09 May 2014 - 07:24 AM

Try adding the if statement around the add_action function.

I have never used the genesis framework so this is just a pure stab in the dark.

 

By the way, the syntax looks weird in your if statement!?

if(is_page_template( ,page_blog.php, ) {
  add_action('genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap');
}


#3 kwmlr439

kwmlr439

    Member

  • Members
  • PipPip
  • 14 posts

Posted 09 May 2014 - 07:31 AM

 

Try adding the if statement around the add_action function.

I have never used the genesis framework so this is just a pure stab in the dark.

 

By the way, the syntax looks weird in your if statement!?

if(is_page_template( ,page_blog.php, ) {
  add_action('genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap');
}
Clarkey,

Thanks for your reply; I just tried to add add the if statement before the functions but didn't work; it just went blank :)



#4 QuickOldCar

QuickOldCar

    Advanced Member

  • Members
  • PipPipPip
  • 1,928 posts
  • LocationNorthEast Pennsylvania

Posted 21 May 2014 - 02:06 AM

if (is_page_template('page_blog.php') ) {
add_action('genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap');
}

DynaIndex.com
Dynamic search index of websites, links, feeds, title, description, keywords and thumbnail snapshot.

#5 QuickOldCar

QuickOldCar

    Advanced Member

  • Members
  • PipPipPip
  • 1,928 posts
  • LocationNorthEast Pennsylvania

Posted 21 May 2014 - 02:12 AM

Clarkey, on 09 May 2014 - 08:24 AM, said:
I have never used the genesis framework so this is just a pure stab in the dark.
 
 
 
genesis framework is just a way to create wordpress themes, in the end is all the same wordpress code.

Edited by QuickOldCar, 21 May 2014 - 02:13 AM.

DynaIndex.com
Dynamic search index of websites, links, feeds, title, description, keywords and thumbnail snapshot.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com