• emaarkhan

    (@emaarkhan)


    Hi,
    I have some hard coded links in footer. which i want to link to pages. But don’t know the url on which i will upload the site.so how can i reach out to that page in anchor tag.so it opens up same page despite whatever the url is?

Viewing 15 replies - 16 through 30 (of 39 total)
  • esmi

    (@esmi)

    Drop a copy of the file into the WordPress pastebin and post the pastebin url here.

    Thread Starter emaarkhan

    (@emaarkhan)

    the custom loop file?

    esmi

    (@esmi)

    Yes please.

    Thread Starter emaarkhan

    (@emaarkhan)

    The wordpress pastebin always shows me page not found but here
    I don’t think i have changed anything in loop.php as i m still learning but still heres the link

    esmi

    (@esmi)

    That code looks fine. The Loop ends with <?php endwhile; // End the loop. Whew. ?>. What’s in your child’s footer.php file?

    Thread Starter emaarkhan

    (@emaarkhan)

    here is footer

    [No bumping. If it’s that urgent, consider hiring someone.]

    esmi

    (@esmi)

    Paste does not exist or has expired.

    Thread Starter emaarkhan

    (@emaarkhan)

    here
    I am having issues with a img which i wrapped around anchor and gave it permalink too. i think its all one problem.
    p.s – i know i m not good. what am i missing?

    esmi

    (@esmi)

    <?php $my_link = get_permalink('neatfold-privacy-policy'); ?>

    You need to use the page/post id – not slug. And please stop bumping. These forums are manned by unpaid volunteers who help when, and as, they can.

    Thread Starter emaarkhan

    (@emaarkhan)

    And please stop bumping. These forums are manned by unpaid volunteers who help when, and as, they can.

    sorry! ?? i remember you said above i can use the name too.because the reason is that i am going to change the permalinks to post name.so if i give post/page id.it would get lost.no?

    esmi

    (@esmi)

    No – I only ever said to use the page/post id.

    Thread Starter emaarkhan

    (@emaarkhan)

    it worked! yay..but other links i give them post/page id, its not working.its on home but after get_template_part( 'loop', 'index' ); so it means its out of loop.right?

    esmi

    (@esmi)

    In theory, yes.

    Thread Starter emaarkhan

    (@emaarkhan)

    but why isn’t it working :/ i only know var_dump way to debug and i did for get_permanlink(5); and came out as bool(false) meaning nothing is return.

    <?php $buy = get_permalink(5); ?>
                <?php var_dump($buy); exit;?>
                <a href="<?php  echo $buy; ?>"><img src="<?php bloginfo('stylesheet_directory') ?>/images/buy.png" /></a>

    esmi

    (@esmi)

    I’ve tested the code in the footer of Twenty Ten and it works fine for me. Check that you have the right post/page id. And just use <?php echo $buy); ?> to examine a string variable.

    Finally, when using an image as a link, the image MUST have any text that is part of that image replicated in the image’s alt attribute – eg:

    <a href="<?php echo $buy; ?>"><img src="<?php bloginfo('stylesheet_directory') ?>/images/buy.png" alt="Buy now" /></a>

Viewing 15 replies - 16 through 30 (of 39 total)
  • The topic ‘linking urls without domain full address’ is closed to new replies.