How to add custom HTML at the end of Post titles in Genesis

Community Forums Forums Design Tips and Tricks How to add custom HTML at the end of Post titles in Genesis

This topic is: not resolved


This topic contains 4 replies, has 2 voices, and was last updated by  ibadullah 1 year, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #103117



    I am moving my site to genesis framework and I am really new here.

    I want to customize my theme but without your help I wouldn’t able to do anything so please help me (:

    Currently I’m running a image gallery website and I want to transfer this feature to genesis framework.

    I want to display the number of images in a post on the title like this screenshot:

    Below is the code which I have to replace with the current the_title(); but I’m failed to find in the whole files :(

    the_title(); global $numpages; global $page ; echo ' ('.$numpages.' Images)';

    How can I replace this with the current Post title?



    Use one of the title filters to append it to the end of each title.

    Default value: get_the_title()
    Applied to the title in the genesis_do_post_title function.

    Default value: $title
    Applied to the output of the title and wrapping heading tags in the genesis_do_post_title function.



    Can you please guide me how to do it?

    I’m really confused.

    I find this get_the_title() code in lib/structure/post.php

    $title = apply_filters( 'genesis_post_title_text', get_the_title() );
    I tried to replace with this
    $title = apply_filters( 'genesis_post_title_text', the_title(); global $numpages; global $page ; echo ' ('.$numpages.' Images)'; );

    But it giving me an error!



    Never edit any code in Genesis.

    Always use the filter in a child themes functions file.

    Using filter functions in WordPress



    I am glad that you’re helping me a lot!

    I understand I have to make changes in functions.php and I’ve to create my custom functions using hooks and filters.

    But as I said earlier I’m using framework first time I’m still unable to create my own first function so please help me how should I code this? ):

    function my_function_name() {
      // Your custom code goes here, between the curly braces
     $title = the_title(); global $numpages; global $page ; echo ' ('.$numpages.' Images)'; );
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.