Sphinx.ita
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: How to..One page website: from menu to pagesThanx Andrew, I tried that as well but couldn’t get through it. It doesn’t echo the menu in this way, but it is still an html structure. Instead I found this way which is perfect:
if (($locations = get_nav_menu_locations()) && $locations['primary_navi'] ) { $menu = wp_get_nav_menu_object( $locations['primary_navi'] ); $menu_items = wp_get_nav_menu_items($menu->term_id); $pageID = array(); foreach($menu_items as $item) { if($item->object == 'page') $pageID[] = $item->object_id; } query_posts( array( 'post_type' => 'page','post__in' => $pageID, 'posts_per_page' => count($pageID), 'orderby' => 'post__in' ) ); }
together with a creation of a walker to modify the links of the menu to a #ID instead of to the permalink.
all things I found today (yey finally!) at themevan
Forum: Fixing WordPress
In reply to: How to..One page website: from menu to pagesI’m trying to build a new one!
I’m using underscore as template, and I’m trying to transform it into a one page.I don’t understand if it’s a very easy simple thing which I can’t get ! or it’s really difficult but I can’t find a solution.
I know how a one page layout functions (with the menu linking to a specific ID on that page), but I don’t understand how do I take the pages listed in the menu, and I add them to the loop!
the solution you provided first, I think it’s the “Automatically add new top-level pages to this menu” which … well, I don’t want to add pages in the menu. I want the pages listed in the menu, to appear on the front page, in the order they are listed in the menu.how to do it? how comes I couldn’t find solution like this online? I feel like or I’m doing something quite stupid or too hard … ! ?
thanx again!
Forum: Fixing WordPress
In reply to: How to..One page website: from menu to pageshmm no, that adds new pages on the menu. which is partially the opposite of what I want to do: I want the pages I put on the menu to appear in that order on a specific (front) page!
??
Forum: Fixing WordPress
In reply to: How to load different CSS files depending on the page?Uff
First thank you WPyogi and dmd before,but either I did explain myself bad, or .. ok probably I did explain myself bad if everybody didn’t understand what I meant.
so I try again
I do not want to load the main style STYLE.CSS for that template !!!
with twentyeleven themes and formers, it was easy to choose WHICH stylesheet to load for a particular template, because the code that calls the style sheets is in the HEADER.PHP file.and I didn’t know where I could write the IF condition that I used to write in the header.php file previously.
if is_page_template('my-very-own-template.php') load this stylesheet else if is an other page template load an other stylesheet else if is page or single or whatever else, load the main style.css stylesheet
kinda of this.
BUT i wrote “i didn’t know” because now I do.
In functions.php file there is the enqueue function that does enqueue the stylesheetso I just make an if statement in my template functions.php file, and I dequeue the style.css file call , and enqueue my very own style sheet when i do want !!!
have I been more clear now? ??
anyway! solved!
thank you and thanx for your replies anyway!!! ??
Forum: Fixing WordPress
In reply to: How to load different CSS files depending on the page?hmm sorry dmd I don’t get it.
I do create different page templates.
but I can’t use the same main style sheet: if i want different background for template A to template B, how can I discern this “condition” on the css sheet?I could write a new css style sheet and load it after the main style sheet, alright. But it looks really not clean and not intelligent to load the 1st main css stylesheet if I don’t use it (lines and lines of code that are loaded for nothing..!)
what did you mean by style them in one style sheet?
thnx!