• I am trying to do the following. From my home page when you click on a read more article I want it to load on the single.php page not from the top but at a specific anchor on the page. I am using this read more on the function.php

    function new_excerpt_more( $more ) {
    return ‘
    . __(‘

    Read More’) . ‘‘;
    }

    add_filter( ‘excerpt_more’, ‘new_excerpt_more’);

    function custom_excerpt_length( $length ){
    return 35;
    }
    add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

Viewing 2 replies - 1 through 2 (of 2 total)
  • jack randall

    (@theotherlebowski)

    single.php will load the contents of any post you create, it’s just a template file. if there’s something in the content that you want to have as a specific point for a link to target then give it an id and then link to it in the url.

    https://yoursite.com/page-or-post-title/#link-id

    Thread Starter raws4581

    (@raws4581)

    Yes.

    Here is the main demo site

    https://www.dpimax.com/v2/news/ scroll to news click on the middle and it does it, but it wont work all the time or for the other news

    i have an id on single.php #article, your help would be appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Anchor link to single.php’ is closed to new replies.