Is it possible to link to other static pages in a Timber template?Link to custom php theme page in wordpressReference - What does this error mean in PHP?home_url() links in wordpress site is getting redirected to some other urlLinks are redirecting to other pages after wordpress upgrade to 4.2.1Timber hash link filter on menu linksShow related post link titleTimber/WooCommerce 3.3.x issue?Uncaught Error: Class 'Timber' not foundUsing Timber to render 3rd party plugin page templatesTimber get_theme_mod in template

What speaks against investing in precious metals?

Implement Own Vector Class in C++

Fixing obscure 8080 emulator bug?

Need feedback - Can the composition/colors of this design be fixed if something is lacking or is not a better fit?

How to manually rewind film?

Meaning of 'lose their grip on the groins of their followers'

How come the nude protesters were not arrested?

Determining the price of an option when it hasn't been traded recently

Why didn't Voldemort recognize that Dumbledore was affected by his curse?

Does a scale have more than seven chords?

How to use memset in c++?

How does an ordinary object become radioactive?

Why can't I use =default for default ctors with a member initializer list

How do I prevent employees from either switching to competitors or opening their own business?

Russian word for a male zebra

Mathematically, why does mass matrix / load vector lumping work?

How to hide an urban landmark?

Rebus with 20 song titles

How to trick the reader into thinking they're following a redshirt instead of the protagonist?

Why can my keyboard only digest 6 keypresses at a time?

How to handle self harm scars on the arm in work environment?

How is water heavier than petrol, even though its molecular weight is less than petrol?

Alternate way of computing the probability of being dealt a 13 card hand with 3 kings given that you have been dealt 2 kings

Is it legal for a bar bouncer to confiscate a fake ID



Is it possible to link to other static pages in a Timber template?


Link to custom php theme page in wordpressReference - What does this error mean in PHP?home_url() links in wordpress site is getting redirected to some other urlLinks are redirecting to other pages after wordpress upgrade to 4.2.1Timber hash link filter on menu linksShow related post link titleTimber/WooCommerce 3.3.x issue?Uncaught Error: Class 'Timber' not foundUsing Timber to render 3rd party plugin page templatesTimber get_theme_mod in template






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Currently, to link to a "FAQ" page, I have the following:



Check out our <a href=" site.link /faq">FAQ</a> page.


However, I'd like to be able to link to other internal pages in my WordPress theme without manually writing in the URL parameters after it. Something like:



Check out our <a href=" site.link('faq') ">FAQ</a> page.


Is this not possible in Timber? I've checked through the docs but don't see any references to it, but I feel like I must be missing something.










share|improve this question




























    0















    Currently, to link to a "FAQ" page, I have the following:



    Check out our <a href=" site.link /faq">FAQ</a> page.


    However, I'd like to be able to link to other internal pages in my WordPress theme without manually writing in the URL parameters after it. Something like:



    Check out our <a href=" site.link('faq') ">FAQ</a> page.


    Is this not possible in Timber? I've checked through the docs but don't see any references to it, but I feel like I must be missing something.










    share|improve this question
























      0












      0








      0








      Currently, to link to a "FAQ" page, I have the following:



      Check out our <a href=" site.link /faq">FAQ</a> page.


      However, I'd like to be able to link to other internal pages in my WordPress theme without manually writing in the URL parameters after it. Something like:



      Check out our <a href=" site.link('faq') ">FAQ</a> page.


      Is this not possible in Timber? I've checked through the docs but don't see any references to it, but I feel like I must be missing something.










      share|improve this question














      Currently, to link to a "FAQ" page, I have the following:



      Check out our <a href=" site.link /faq">FAQ</a> page.


      However, I'd like to be able to link to other internal pages in my WordPress theme without manually writing in the URL parameters after it. Something like:



      Check out our <a href=" site.link('faq') ">FAQ</a> page.


      Is this not possible in Timber? I've checked through the docs but don't see any references to it, but I feel like I must be missing something.







      php wordpress twig wordpress-theming timber






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 18:10









      OneMohrTimeOneMohrTime

      597




      597






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You can add the pages into your context using the filter timber_context



          add_filter('timber_context', 'add_to_context');

          function add_to_context($context)
          /* this is where you can add your own data to Timber's context object */
          $extraLinks = [];
          $extraLinks['faq'] = get_permalink($faq_ID);
          $context['site']['extraLinks'] = $extraLinks;
          return $context;



          So you can call in your twig file



          Check out our <a href=" site.extraLinks.faq ">FAQ</a> page.


          source






          share|improve this answer























          • Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

            – OneMohrTime
            Mar 26 at 18:30











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326909%2fis-it-possible-to-link-to-other-static-pages-in-a-timber-template%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You can add the pages into your context using the filter timber_context



          add_filter('timber_context', 'add_to_context');

          function add_to_context($context)
          /* this is where you can add your own data to Timber's context object */
          $extraLinks = [];
          $extraLinks['faq'] = get_permalink($faq_ID);
          $context['site']['extraLinks'] = $extraLinks;
          return $context;



          So you can call in your twig file



          Check out our <a href=" site.extraLinks.faq ">FAQ</a> page.


          source






          share|improve this answer























          • Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

            – OneMohrTime
            Mar 26 at 18:30















          1














          You can add the pages into your context using the filter timber_context



          add_filter('timber_context', 'add_to_context');

          function add_to_context($context)
          /* this is where you can add your own data to Timber's context object */
          $extraLinks = [];
          $extraLinks['faq'] = get_permalink($faq_ID);
          $context['site']['extraLinks'] = $extraLinks;
          return $context;



          So you can call in your twig file



          Check out our <a href=" site.extraLinks.faq ">FAQ</a> page.


          source






          share|improve this answer























          • Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

            – OneMohrTime
            Mar 26 at 18:30













          1












          1








          1







          You can add the pages into your context using the filter timber_context



          add_filter('timber_context', 'add_to_context');

          function add_to_context($context)
          /* this is where you can add your own data to Timber's context object */
          $extraLinks = [];
          $extraLinks['faq'] = get_permalink($faq_ID);
          $context['site']['extraLinks'] = $extraLinks;
          return $context;



          So you can call in your twig file



          Check out our <a href=" site.extraLinks.faq ">FAQ</a> page.


          source






          share|improve this answer













          You can add the pages into your context using the filter timber_context



          add_filter('timber_context', 'add_to_context');

          function add_to_context($context)
          /* this is where you can add your own data to Timber's context object */
          $extraLinks = [];
          $extraLinks['faq'] = get_permalink($faq_ID);
          $context['site']['extraLinks'] = $extraLinks;
          return $context;



          So you can call in your twig file



          Check out our <a href=" site.extraLinks.faq ">FAQ</a> page.


          source







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 25 at 20:26









          Lincoln LemosLincoln Lemos

          984




          984












          • Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

            – OneMohrTime
            Mar 26 at 18:30

















          • Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

            – OneMohrTime
            Mar 26 at 18:30
















          Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

          – OneMohrTime
          Mar 26 at 18:30





          Not entirely the way I assumed, but definitely a good resolution. I may just turn this into an array() for common top-level pages...

          – OneMohrTime
          Mar 26 at 18:30



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55326909%2fis-it-possible-to-link-to-other-static-pages-in-a-timber-template%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript