Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_action( 'after_page_content','custom_title',1); #114

Open
bassjobsen opened this issue Mar 5, 2014 · 1 comment
Open

add_action( 'after_page_content','custom_title',1); #114

bassjobsen opened this issue Mar 5, 2014 · 1 comment

Comments

@bassjobsen
Copy link
Owner

Question from @mjteves1986:

I use the add_action( 'after_page_content); on my child themes. The code is perfect. But I have something in my mind, why if I use "before_page_content" is not working, Only "after_page_content" will work. Im planning to create a title page on the top on the content.

This is my code.

The result of that code is like this: http://screencast.com/t/A5vZQDB8

Is it possible to use a add_action( 'before_page_content','custom_title',1);
to make the result insert that title before " .contentwrap #page "? So that the title will be like this?
See link: http://screencast.com/t/AeDas11k

For now, Im using
jQuery(".contentwrap .page-header").insertBefore(".contentwrap #page");
to get my goal.

@bassjobsen
Copy link
Owner Author

Hi Mark,

If i understand you question well, i expect you should be able to use:
add_action( 'jbst_header','custom_title',55); to find all action hooks, please take a look at:
https://github.com/bassjobsen/Boilerplate-JBST-Child-Theme

Please let me know if the above will help you? If not please tell me why?

I also saw you define a new templates for this. I understand the hooks should work that you can do:

           add_action( 'jbst_header',function(){ if(is_page())echo 'custom title';},55);

Add the above in your template before get_header()

This won't work now cause you will get the title twice. Currently jbst_page_title(); isn't hooked. For the next update i will hook this function too and also create a filter for the page title, so you can do:

           remove_action('jbst_show_page_title' 'jbst_page_title');
           add_action( 'jbst_header',function(){ if(is_page())echo 'custom title';},55);

and / or
add_filter('jbst_page_title_html','custom_header');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant