• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

bluenavy

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • May 16, 2023 at 7:16 am in reply to: entry – title – link #507418
    bluenavy
    Participant

    I found this code to remove the url but not to amend it

    //* Remove the link from each post title - WORKING
    add_filter( 'genesis_post_title_output', 'ytn_post_title_output', 15 );
    	function ytn_post_title_output( $title ) {
            $title = sprintf( '<h2 class="entry-title">%s</h2> ', apply_filters( 'genesis_post_title_text', get_the_title() ) );
    		return $title;
    	}
    
    May 16, 2023 at 6:20 am in reply to: entry – title – link #507417
    bluenavy
    Participant

    I have tried to fix this for 3 days but I just can't figure it out :0(

    Somebody put an old dog out of his misery

    May 16, 2023 at 6:16 am in reply to: entry – title – link #507416
    bluenavy
    Participant

    Example

    January 31, 2019 at 1:57 am in reply to: Shortlink at the bottom of content on a tag post #489174
    bluenavy
    Participant

    done

    January 31, 2019 at 1:45 am in reply to: Shortlink at the bottom of content on a tag post #489172
    bluenavy
    Participant

    @braddalton

    Thankyou for your response.

    Is this something you could code on a developer basis ( for a fee of course )

    If so, please let me know and length of time to create.

    Many Thanks

    January 31, 2019 at 12:49 am in reply to: Shortlink at the bottom of content on a tag post #489170
    bluenavy
    Participant

    Thanks for the link, but have absolutely no idea what to do with that LOL

    function get_term_link( $term, $taxonomy = '' ) {
        global $wp_rewrite;
     
        if ( !is_object($term) ) {
            if ( is_int( $term ) ) {
                $term = get_term( $term, $taxonomy );
            } else {
                $term = get_term_by( 'slug', $term, $taxonomy );
            }
        }
     
        if ( !is_object($term) )
            $term = new WP_Error( 'invalid_term', __( 'Empty Term.' ) );
     
        if ( is_wp_error( $term ) )
            return $term;
     
        $taxonomy = $term->taxonomy;
     
        $termlink = $wp_rewrite->get_extra_permastruct($taxonomy);
     
        /**
         * Filters the permalink structure for a terms before token replacement occurs.
         *
         * @since 4.9.0
         *
         * @param string  $termlink The permalink structure for the term's taxonomy.
         * @param WP_Term $term     The term object.
         */
        $termlink = apply_filters( 'pre_term_link', $termlink, $term );
     
        $slug = $term->slug;
        $t = get_taxonomy($taxonomy);
     
        if ( empty($termlink) ) {
            if ( 'category' == $taxonomy )
                $termlink = '?cat=' . $term->term_id;
            elseif ( $t->query_var )
                $termlink = "?$t->query_var=$slug";
            else
                $termlink = "?taxonomy=$taxonomy&term=$slug";
            $termlink = home_url($termlink);
        } else {
            if ( $t->rewrite['hierarchical'] ) {
                $hierarchical_slugs = array();
                $ancestors = get_ancestors( $term->term_id, $taxonomy, 'taxonomy' );
                foreach ( (array)$ancestors as $ancestor ) {
                    $ancestor_term = get_term($ancestor, $taxonomy);
                    $hierarchical_slugs[] = $ancestor_term->slug;
                }
                $hierarchical_slugs = array_reverse($hierarchical_slugs);
                $hierarchical_slugs[] = $slug;
                $termlink = str_replace("%$taxonomy%", implode('/', $hierarchical_slugs), $termlink);
            } else {
                $termlink = str_replace("%$taxonomy%", $slug, $termlink);
            }
            $termlink = home_url( user_trailingslashit($termlink, 'category') );
        }
        // Back Compat filters.
        if ( 'post_tag' == $taxonomy ) {
     
            /**
             * Filters the tag link.
             *
             * @since 2.3.0
             * @deprecated 2.5.0 Use 'term_link' instead.
             *
             * @param string $termlink Tag link URL.
             * @param int    $term_id  Term ID.
             */
            $termlink = apply_filters( 'tag_link', $termlink, $term->term_id );
        } elseif ( 'category' == $taxonomy ) {
     
            /**
             * Filters the category link.
             *
             * @since 1.5.0
             * @deprecated 2.5.0 Use 'term_link' instead.
             *
             * @param string $termlink Category link URL.
             * @param int    $term_id  Term ID.
             */
            $termlink = apply_filters( 'category_link', $termlink, $term->term_id );
        }
     
        /**
         * Filters the term link.
         *
         * @since 2.5.0
         *
         * @param string $termlink Term link URL.
         * @param object $term     Term object.
         * @param string $taxonomy Taxonomy slug.
         */
        return apply_filters( 'term_link', $termlink, $term, $taxonomy );
    }
    January 30, 2019 at 11:42 pm in reply to: Shortlink at the bottom of content on a tag post #489166
    bluenavy
    Participant

    @braddalton

    Thanks for the response.

    What I meant was that I was trying to make the shortlink just replicate the shortlink url, the issue i am facing is that if I have 2, 3, 5, 11, 20 or 30 pages, if i just put a generic text in ( 'Your link text here' ) then it will be the same for all pages and I wanted the individual shortlink to be replicated in text.

    With regards to using a different function, for the lack of trying I did try to glean some info online but was a tad overwhelmed with the jargon.

    Do you have nay ideas on a simple way to get the tag archive permalink ?

    The hook ( I hope that is the correct phrase ) is correct and the shortlink displays where it should be.

    Is this the bit which defines the post type

    if ( is_tag() ) {

    I could live with just putting a generic ( 'Aortic Deviation' ) in the that field and its just the shortlink being based on the tag archive permalink that is really throwing me ;(

    January 30, 2019 at 4:34 am in reply to: Shortlink at the bottom of content on a tag post #489140
    bluenavy
    Participant

    @braddalton

    That works a treat just two little niggles which may be an easy one for you to assist.

    I am using the below code from your site - https://wpsites.net/web-design/add-shortlink-anywhere-in-genesis/

    Great resource and bookmarked !

    add_action( 'genesis_after_post_content', 'add_wp_get_shortlink' );
    function add_wp_get_shortlink() {
        printf( '<a href="%s">' . __( 'Your link text here' ) . '</a>',  __( wp_get_shortlink() ) );
    }

    It outputs the shortlink at the bottom of the page as needed ( Thankyou !! )

    Is their a way I can tweak the ( 'Your link text here' ) code to change the outputted text to the shortlink ie https://myshortlinkonthesceenatthebottom.com/wootwoot

    Secondly the shortlink is being generated to the post permalink as opposed to the permalink of the actual tag archive page.

    Is their a way to tweak that so the shortlink generated is strictly based on the tag archive page permalink ?

    If it helps my permalink structure is based on /%category%/%postname%/ and my tag base is 'aortic aneurysms'

    Thankyou so much in advance and I apologise for my incorrect terminology or if I am not as fluent in the code language.

    Thanks

    January 30, 2019 at 1:51 am in reply to: Shortlink at the bottom of content on a tag post #489139
    bluenavy
    Participant

    yes sorry for my bad terminology ::embarrassed::

    Ideally i would like to add something to that code so it all outputs the same

    Sorry for the confusion

    January 30, 2019 at 1:41 am in reply to: Shortlink at the bottom of content on a tag post #489137
    bluenavy
    Participant

    @VictorFont

    Hi Victor - I have created a post and have added 5 tags to the post.

    This has generated 5 tag posts that have their own individual permalinks.

    I have used the case i posted to get wordpress to put a shortlink under the content but it has just worked on the 1 post and not for the tag posts.

    I presume the code to get it to work on the post is not directed at tag posts and I just wanted to know what I would target to get a shorter to be outputted to all the tag posts ?

    The code currently reads

    add_filter( "the_content", "astp_add_shortlink", 11 );

    would the below suffice ?

    add_filter( "genesis_after_post_content", "astp_add_shortlink", 11 );

    or is their a filter that would enable me to enable a shortlink to be displayed at the bottom of all tags, posts or pages or any other post taxonomy ?

    Thanks

    January 30, 2019 at 1:38 am in reply to: Shortlink at the bottom of content on a tag post #489135
    bluenavy
    Participant

    @VictorFont

    Hi Victor - I have a post and have added 5 tags to the post.

    This has generated 5 tag posts that have their own individual permalinks.

    I have used the case i posted to get wordpress to put a shortlink under the content but it has just worked on the 1 post and not for the tag posts.

    I presume the code to get it to work on the post is not directed at tag posts and I just wanted to know what I would target to get a shorter to be outputted to all the tag posts ?

    The code currently reads

    add_filter( "the_content", "astp_add_shortlink", 11 );

    would the below suffice ?

    add_filter( "genesis_after_post_content", "astp_add_shortlink", 11 );

    or is their a filter that would enable me to enable a shortlink to be displayed at the bottom of all tags, posts or pages or any other post taxonomy ?

    Thanks

    January 30, 2019 at 1:26 am in reply to: Shortlink at the bottom of content on a tag post #489133
    bluenavy
    Participant

    @braddalton

    its local dev site - its just a normal tag post.

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble