PBWordpressDP
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: A good WordPress CMS TutorialI already know php.
But the majority of the wordpress book don’t go into the details of CMS websites.
What I want to do with wordpress is this:
Add/edit text to pages.
Add/edit items to pages (such as box like content (with image, text, title).Basically things you do with any other CMS.
It seems I need to create fields with magic fields for the simplest of things, making the admin area of wordpress quite complicated.
Forum: Fixing WordPress
In reply to: Pagination for a WordPress siteCouldn’t find the plugin for the link.
Also,I need to be able to put the pagination to where I want on the page, not just posts.
I don’t think the plugin could recognize what is to be paginated since its all custom coded, with little to do with the posts types.
Forum: Fixing WordPress
In reply to: get_the_date function not returnig post publish dateIt works!
Thanks. Your reply helped me solve it.
I used the ID I get from the address bar instead.
$post= $_GET['post_id']; <span><?php echo get_the_time('d/m/Y', $post); ?></span>
Forum: Fixing WordPress
In reply to: get_the_date function not returnig post publish dateThanks for your reply.
I have tried your suggestion, but I get exactly the same date.
There has to be way though, since I can see the posts publish date (a different date) in the wordpress admin area. These posts are listed under “Articles” which I created using magic fields. They are of type post. And the publish date is as I expect there. If I could find the same function which is being called here in admin area, to call it on the webpage.
Forum: Fixing WordPress
In reply to: get_the_date function not returnig post publish dateI’ve figured out why the get_date function is not working as I expected it to.
It is getting the date of the page, instead of the post (custom field).
I am using WordPress as a CMS, so the page serves as a container or layout to my posts on the page. So when I call the get_the_date function it gets the date of the page.
Is there a function to get the date of the post(custom field)?
Forum: Fixing WordPress
In reply to: get_the_date function not returnig post publish dateHere is the code. Thanks. <script src="https://pastebin.com/embed_js.php?i=8En7d9mR"></script>
Forum: Fixing WordPress
In reply to: get_the_date function not returnig post publish dateHere is the code. Thanks.
<script src=”https://pastebin.com/embed_js.php?i=8En7d9mR”></script>
Forum: Fixing WordPress
In reply to: Script to add data to wp db tables from an XML file using PHPI am currently able to import an XML file through Tools->Import->Wordpress (selecting a WXR (xml)) file. This populates the wp_postmeta as expected. I now just want to automate this process. So I would simply drop an XML file into a folder, and a scheduled script would automatically do the rest.
Forum: Fixing WordPress
In reply to: Script to add data to wp db tables from an XML file using PHPI want to add entries to the wp_postmeta table. There are a number of entries added in a single item entry from the XML.
A content provider will upload xml files to a ftp folder, and a script will import the newly added XML file(which will add new items) into the wp_postmeta table.
Forum: Fixing WordPress
In reply to: Script to add data to wp db tables from an XML file using PHPAlso, where is the code or function that executes the import XML file when you hit the import button. Perhaps this code would be of some use.
I most certainly refreshed the page. I had the admin area open in one tab, and the website on the other.
I could see the text, the and some of the images even. However one image would be missing. When I would click Update in the admin area, and then refresh on the other tab (webpage) then the image would appear next to the already visible text (text which was added from the XML import).
Front-end. A very strange problem. All I am trying to do is import an XML file to populate db table that will reflect changes on the webpage.
I exported the XML file using the wordpress tools menu. Once I saw the structure of the exported XML, I knew how I should add new items. So shortened the XML file to add just one item.
All works fine, but strangely, some images are not displayed on the webpage. However, by simply going to the front-end (admin area) and selecting the relevant post, and clicking the Update button (WITHOUT having changed anything or uploading any images) the image begins to appear. I have no idea why this happens.
Why doesn’t the image display immediately after I uploaded the XML file? Why would going to post and simply clicking Update button cause it to appear?
Forum: Fixing WordPress
In reply to: Simple OR statement not workingThank you very much. That solved the problem! ??
Forum: Fixing WordPress
In reply to: Simple OR statement not workingThanks for your response.
I have a number of posts,listed in the categories section. I have managed to write a loop that echos all the categories onto the page. But I do not want ‘Uncategorized’ or ‘NEWS’ to be displayed. So inside the while loop, I wrote an if statement, so that it would not echo these to the web page.
So:
//loop starts
if ($cat->cat_name != ‘NEWS’ || $cat->cat_name != ‘Uncategorized’) {echo $cat->cat_name;
}
//loop endsResult:
All the categories are listed except ‘NEWS’.Result I am trying to get:
All the categories should be listed except ‘NEWS’ and ‘Uncategorized’