Tagged Questions

The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
25 views

User Selectable Delete of Pages

in my WP MultiUser project i am designing a template for deleting a page from the front-end (only the super admin can access the back-end admin panel) I have almost achieved the desired result, but ...
0
votes
1answer
40 views

get_pages — parent vs child_of?

I'm working with get_pages on a site that has a very clean and hierarchical structure. As part of a template, I wanted to show child pages as part of the template's 'boilerplate'. Reading the Codex ...
0
votes
0answers
63 views

Getting post content within wp_nav_walker

I have a custom walker set up designed to add content into the nav menu. The problem being that it is not pulling the content. The post object returned by the get_post/get_page has an empty ...
0
votes
1answer
262 views

Why is get_pages() returning a boolean?

I have created a custom post type that I want to use to allow people to add an arbitrary number of sections to the homepage of my theme. I want to loop through all posts of that type and include their ...
0
votes
1answer
138 views

Parent Page > Child Page Menu

I am trying to create a collapsible menu using Bootstrap. The problem I am having is getting the correct Wordpress PHP code to call the right pages. Also this menu will be displayed on these child ...
0
votes
0answers
688 views

Get page content and execute shortcodes on a page

I would like to get show multiple page's content on one page with shortcodes. If I use return $html; the shortcodes not working, if I use return do_shortcode($html); the shortcode working, but the ...
0
votes
1answer
98 views

Hooking get_posts()

On a site this is a plugin that uses get_posts() to make a list of pages. The list is used to create a list of pages and create next page and previous page links. ( ...
0
votes
2answers
180 views

Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)

I've spent a few days researching working with WP static pages - as separate from posts. Although I've found useful guidance, I can't seem to find any good tutorials or worked examples that show me ...
0
votes
0answers
143 views

get_pages not returning any results or error when get_posts works

I have a code sample that works with get_posts but I now need do with get_pages so I can get grandchildren in the results set: $attachments = get_posts( array( 'post_type' => 'attachment' ...
0
votes
1answer
200 views

how to display all images from their siblings/ from same parent?

I need to know how to display all images from the current page siblings. for eg. I got two parents (Hockey and football) with children. In all this children I got one or several images attached (I've ...
0
votes
1answer
141 views

Add page as static html into another page

Is there a way to include a wordpress Page into another one? I'm not just talking about getting the content using get_page(), but to import the whole page (theme + content). I have been looking around ...
0
votes
1answer
189 views

Set order of returned items in the WP_Query() class/function

I have this function which gives me IDs and titles of all child pages of a given parent ID. function getPageChildren($page_id) { $my_wp_query = new WP_Query(); $all_wp_pages = ...
0
votes
1answer
2k views

Display content of page template (get_page)

My problem is that I displayed content of 3 pages on index.php by using get_page(). The problem is that each of those pages have own page template /* Template Name: another page template */ which ...
0
votes
4answers
685 views

How to limit the characters shown on the page - get_content

I've the below php to display the content of the post id#9 on my 'home page' of my site, so that whenever the client updates the page, it's reflected on the homepage as well - rather than having to ...
1
vote
1answer
917 views

get_pages() as per custom menu order

I'm working on Single Page WordPress Theme where I want to get_pages() as per custom menu order. I have gone through the reference for get_pages() which only allows for default menu : ...
0
votes
1answer
196 views

parent page grabbing wrong url for child pages - get_page_uri($pageChild)

I have a landing page that pulls in an excerpt, title and thumbnail of its children. It works, except the title (which is the page title) link is doubling up the parent folder in the url it creates. ...
1
vote
2answers
9k views

get page title, url and excerpt of a page

I have the following setup: the front-page is setup as 'static' and it uses a theme page template. On this template / front-page, I need to get the page title, URL and excerpt of the About page. I ...
0
votes
1answer
594 views

Apply class to every third list item? [duplicate]

Possible Duplicate: How to mark every 3rd post I'm trying to give a class to every third list item on my page. I know how to give a class to every item, but not to specific items in a row, ...
0
votes
1answer
192 views

Sort the data in Wordpress using get-page-by-title

Just got this "fresh" task this morning. I have a website that using the following syntax $thenews = get_page_by_title(date("Y")); But in the website it's displaying not the latest news. What ...
0
votes
2answers
1k views

How to get ID of the page included with get_page()?

I'm rewriting the question, including exemplary code, I hope it will be easier to understand now. 1. My shortcode: function testid_shortcode( ) { global $post; return ...
0
votes
2answers
418 views

get_page() - Only variables can be passed by reference

When I try to use get_page() function I get the error message: Only variables can be passed by reference   But what doesn't make sense is that I can use a work around that blows my mind: ...
0
votes
1answer
120 views

Add HTML to Page Content

I'm accessing a page content from outside WordPress, in a different webpage. Everything runs fine, I'm using this: require("wp-load.php"); $page_id = 300; $data = get_page($page_id); echo ...
1
vote
1answer
1k views

How to use get_page_by_title() with qTranslate?

Any idea how I can use the WP function get_page_by_title() with qTranslate installed? for example: $page_contact = get_page_by_title( '_e("[:en]contact");' ,'page' ); $page_contact_ID = ...
0
votes
3answers
580 views

How to get pages of parent (non-recursive)?

I'd like to get all pages that are direct children of HOME_ID. Per http://codex.wordpress.org/Function_Reference/get_pages#Parameters (see 'parent' parameter), I think this should be done with ...
0
votes
3answers
713 views

how to include page content to specified length & then “read more” link

I'm pretty new to WP, so please forgive any stupid questions and/or coding! I'm using the following code in my index.php file to include content from another page: <div id="tm-container"> ...
0
votes
1answer
475 views

get_pages and number - no output; no errors;

I am attempting to get 3 pages from the parent page (id is 2035). I am using wordpress 3.2.1. Here's my relevant code: <div id="videos" class="contentLeft"> <?php // get the three most ...
-1
votes
1answer
991 views

get_page() unlike Loop returns the post content without html tags. How can I fix this?

get_page() unlike Loop returns the post content without html tags. I need tags. How can I fix this? I don't want to change wysiwyg editor, here is the bad solution ...
1
vote
1answer
4k views

Sort “get_pages” by menu order not ordering

I'm using this bit of code to generate a page full of items but they won't sort into the menu order, any ideas as to why? <?php $pages = get_pages(array('child_of', 'menu_order')); ?>
1
vote
1answer
1k views

Limit get_pages to only show 5 items

How can I limit the get_pages to only show 5 items? I thought adding 'number' => 5 to the array would limit it to 5 but it doesn't show anything. Here's my code: <?php $pages = ...
6
votes
5answers
2k views

get_pages() not ordering as it should

I'm using get_pages() function to get all subpages from a page like this: $childrens = get_pages(array('child_of' => 7, 'sort_column' => 'post_date', ...
3
votes
4answers
10k views

How to get the specific Page's current ID and use it in a get_page function?

Example of the code: $page_id = 116; // 123 should be replaced with a specific Page's id from your site, which you can find by mousing over the link to edit that Page on the Manage Pages admin page. ...