I have a query set up for the posts. All the pages are being displayed right now on the main site (as I want, it was intended to be one long page). The pages however are not querying. I could not find how to grab the page info rather then post info.
That is the page (in a nutshell, still needs actual design work) the nav at the top reflects the pages I created. Which are all below the twitter feed. Each heading you see after the twitter feed is its own page.
Should be as simple as doing this for the query:
query_posts( ‘post_type=page&orderby=title&order=DESC’ );
…or whatever options you want.
And you don’t need to use the slug at all for an identifier, you can just use the ID like you did above:
Yes it was, and that function worked great. And yeah I had the ID outside but noticed it giving a ton of extra classes and an extra page wrap. Fixed now to where every page is inside the proper wrap and given its own class.
All that is left for functionality is to see if I can somehow change the nav to go directly to the page. If not, I’ll just stick with the custom menu so everything goes to the anchor I tell it to.
It does not. How it is set-up right now it jumps to an anchor lower on the page, which I added into the content of each page and given a name. I’m trying to see if I can find a more dynamic way of doing that. Also since my nav is fixed up top, I need it to jump to the anchor but -50px or so. I achieved this in mockups without wordpress by giving the anchor position:absolute and then forcing it to the top of the parent page element. But trying to… wordpressify it.
So like this…
returns me the name of the title. Now I don’t have to manually ad an anchor inside each of the pages content. However I still have to manually add a menu item and then link it to said anchor. But this automates the process a bit. Thanks to you guys for giving me the idea. You can give class and ID’s, so I figured why not names also? But still need to push it up a bit so You can see the full page and title when you use the nav.
So, taking that a step forward. I have that anchor set above the heading. It will automatically create an anchor with the name of the title and .ap, while staying inside the .page of each “page” (which I am just treating as content for the site).
Afterwards I can then tell my nav to link to #whatever the name is of the anchor (which is the title of each section)
And since each page has a padding-top of 100px to divide the content, the .ap class is position:absolute; top:0. Which makes it so it won’t hide the content you click to navigate to. This little experiment made me have a sudden realization of what some basic php can do.
You must be logged in to reply to this topic.