WordPress.org

Support

Support » Themes and Templates » Where are the actions defined?

Where are the actions defined?

  • Hi Richie,
    I am still tweaking your wonderful Theme, Mesocolumn.

    Just a quick question: in which file are your actions defined (such as “do_action( ‘bp_head_before_title’ )”, etc.)? I have looked through most files, but couldn’t figure it out until now.

    Thanks in advance.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author Richie KS

    @rkcorp

    it is a hook action. nothing hook into yet.
    for example if you add something like to your custom function

    function hello_text() {
    echo 'hello world';
    }
    //here's the hook come in handy
    add_action('bp_head_before_title','hello_text');

    then the ‘hello world’ text will appeared in before <title> without touching the header.php

    Thanks for your reply, Richie.

    I do understand how add_action and do_action work.
    My problem is: WHERE do you define your add_action’s?

    The reason why I need this: I need to modify files such as page.php, where I want to change some of the lay-out, for instance I need to modify the content of:
    <?php do_action( ‘bp_after_page_content’ ); ?>

    I just can’t find where you define ‘bp_after_page_content’ and the other actions. 🙂

    Theme Author Richie KS

    @rkcorp

    there’s nothing hook into all the action hook. unlike any wp framework that hook the html into the action_hook. this theme did not so currently there’s nothing defined inside any of the do_action() hook.

    also recon you add any new functions in lib/functions/custom-functions.php rename it from custom-functions-sample.php first.

    Thanks again for your quick reply.

    I am so confused now. If I understand you correctly, you are saying that none of your ‘bp_*’ actions are defined at the moment. Is that correct?

    And I could define those in a custom-functions.php? Which is quite a neat feature that you have built in.

    My confusion is that I thought I understand your code, but apparently I don’t. :-O

    Let me give you an example of a more basic question that I am trying to resolve. On a post page, you allow for social buttons, an advert, tags, and links to related posts, all below the actual article. I would like to change the order of these additional features, maybe also change their appearance.

    Where (and how) do I do that?

    Thanks, Richie.

    Theme Author Richie KS

    @rkcorp

    yes, i’m affraid you will need to edit them in single.php, they were coded inside single.php template not action hook. maybe try child theme approach.

    Thanks Richie,
    that really helped.

    I also am now in the process of converting my changes to a child theme.

    Previously I had hard coded the dutch language into your PHP files. I have now undone that and created nl.NL language files, which works fine.

    On the converting to the child theme: that seems to behave strangely. So, I have a clean mesocolumn installation now, and added the child-theme by copying your mesocolumn-child folder to the folder where all the themes are, so besides the mesocolumn folder.

    If I then switch to the child theme in wordpress, there are a few problems:
    1) for the normal site (wider screen) to primary menu is all messed up. One menu item is missing, the order of items has changed and the category colors that I had defined are no longer there.
    2) the mobile site (so screen width <770px) has also a problem with the menu: the ‘select page’ and ‘select menu’ options on top have disappeared. There is still a orange bar, but it is not as high as it should be.

    Other than that the child theme works.

    Any thoughts?

    (If you want the put the previous topic down as ‘resolved’, then that is fine with me. I can then raise the child theme issue in a now topic.)

    Thanks again.

    Theme Author Richie KS

    @rkcorp

    could you check your child theme style.css, some bug with the template name from latest version 1.6.1

    Template: mesocolumn-plus
    should be
    Template: mesocolumn

    or
    you might need to resave the custom menu location for the menu to show in mobile.

    Hi Richie,
    I had done all that already. Unfortunately that does not solve the issue.

    Naturally, I had changed the Template, by deleting the ‘-plus’.

    I feel I have tried all I can. I resaved all mesocolumn settings, just in case the child theme needs that reset. But the issue remains.

    I really don’t feel like setting up the whole site from scratch, just so I can use the child theme. The main theme, with some of my own mods works perfectly. But I will get into trouble once there is a theme update of course.

    Theme Author Richie KS

    @rkcorp

    not sure why but the child theme did inherit parent styles and menu in my end. is it cache issue?

    if you saved the theme options, cat or page color using child theme and resave the menu location etc, did any of the save optons work?

    must some template in parent theme that you previous edits that were not sync with latest version.

    try backups/moved your edited version of mesocolumn(dutch)
    download latest version 1.6.1 (no edit)
    and try the child theme settings theme option, cat,page color again.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Where are the actions defined?’ is closed to new replies.