Results 1 to 4 of 4

Thread: Hooks. actions, functions etc.

  1. #1
    Thread Starter
    Senior Member pjreynolds's Avatar
    Join Date
    Oct 2012
    Location
    United Kingdom
    Posts
    159
    Thanks
    9
    Thanked 6 Times in 6 Posts

    Hooks. actions, functions etc.

    Hi there,

    I've been trying to get my head around the hooks, actions, functions etc and how to edit them when using a child theme in Vantage but still struggling somewhat. As you can tell I'm new to php and although I've read the various tutorials suggested on this forum, I'm not getting very far!

    I've worked out how to modify the template files in the root of the child theme and get them working, but when it comes to the files within the sub-folders such as images / includes / framework etc. I hit a brick wall.

    There are several changes I want to make but If I just give one example here, perhaps I can use the solution provided to get my head around everything better/

    Increasing the excerpt length on category pages

    From what I can tell, I would need to change the following:

    This line of code on content-listing.php:

    <p class="listing-description"><strong><?php _e( '', APP_TD ); ?></strong> <?php the_excerpt(); ?> <?php echo html_link( get_permalink(), __( 'Read more...', APP_TD ) ); ?></p>

    And add a new function to functions.php which includes this code:

    function custom_excerpt_length( $length ) {
    return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    Am I sort of along the right lines?

  2. #2
    dimitris's Avatar
    Join Date
    Oct 2011
    Location
    Earth
    Posts
    20,618
    Thanks
    222
    Thanked 1,873 Times in 1,770 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    tcarter's Avatar
    Join Date
    Jun 2011
    Location
    United States
    Posts
    424
    Thanks
    15
    Thanked 91 Times in 77 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Thread Starter
    Senior Member pjreynolds's Avatar
    Join Date
    Oct 2012
    Location
    United Kingdom
    Posts
    159
    Thanks
    9
    Thanked 6 Times in 6 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Related Ads using hooks (functions.php) in child theme
    By plink in forum ClassiPress General Discussion
    Replies: 4
    Last Post: May 5th, 2012, 01:22 AM
  2. Using hooks to change functions or remove them
    By coza in forum JobRoller General Discussion
    Replies: 3
    Last Post: February 14th, 2012, 04:29 AM
  3. child theme - functions - theme actions
    By pauro in forum Report ClassiPress Bugs
    Replies: 5
    Last Post: January 3rd, 2012, 06:56 AM
  4. Reasoning behind putting everything into functions and sub functions?
    By rodeoramsey in forum Report ClassiPress Bugs
    Replies: 12
    Last Post: November 16th, 2011, 11:05 AM
  5. theme-actions.php
    By billis in forum ClassiPress General Discussion
    Replies: 1
    Last Post: November 2nd, 2011, 10:54 AM