marcnyc
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: changing title to page in get_header()I did not doubt your @joyously but a week ago I tried it and it didn’t work (not because of you, but because I’m a WP novice and I couldn’t apply the code you suggested to my example)… the code I found there worked right off the bat… I’m still not sure I understand it but it does work ??
thank you for helping me all alongForum: Developing with WordPress
In reply to: changing title to page in get_header()Just wanted to report that I did find a solution that worked here: https://wordpress.stackexchange.com/questions/62415/changing-document-title-only-on-a-custom-page-template
Forum: Developing with WordPress
In reply to: changing title to page in get_header()The point is to have a unified look across all the pages of the website. Since the header and footer are generated by WP I want the same headers and footers across all pages
Forum: Developing with WordPress
In reply to: changing title to page in get_header()Ok, here’s the real life scenario:
https://www.chaindlk.com is the site i run
it’s wordpress, except for this section:
https://www.chaindlk.com/reviews which is a custom CMS specific to music reviews that was built custom for that site years ago (before the rest of the site migrated to WP).
It uses $_GET URL query strings to find reviews (https://www.chaindlk.com/reviews/?id=11356) or to select categories (https://www.chaindlk.com/reviews/index.php?type=music&category=4) or to perform searches (https://www.chaindlk.com/reviews/index.php?search=test&type=music) or to select type of reviews, from music, to books etc (https://www.chaindlk.com/reviews/?type=books) – all of these type of URL-based calls would break if I included the contents of this page inside a WP page with a plugin that allows for PHP inclusion.
And then there is the admin side of that custom script which makes heavy use of $_POST variables, which would also break if it were simply included…
if it were as easy to include I would have used the PHPinclude()
function and just installed a WP plugin that allows me to run PHP code.
So unless I still don’t understand what you mean, I don’t see a way to wrap all this external code into WPForum: Developing with WordPress
In reply to: changing title to page in get_header()Thank you for thinking of me and posting… 3 of those are old and outdated… the one that could have worked (Include Me) didn’t work (not sure why, and I’m looking into it)… but i have little hope that a plugin will be able to include an entire script that generates output on multiple pages, with search queries, URL queries ($_GET and &_POST) etc… I guess an iFrame that is dynamically resized with every page call COULD work but that wouldn’t solve the issue of changing the title to the page we are on so it defeats the purpose
Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionswp_insert_post and wp_handle_upload make total sense but I don’t understand how wp_media_upload_handler works since it takes no parameters… how/when do I run that in relation to wp_handle_upload?
It doesn’t appear to do the resizing… which function does the resizing of the images and the creation of the meta data in the database?Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsthanks will read up
Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsthanks for the reply.
would you mind telling me which wordpress functions do the following 5 things?– creates a post
– upload an image
– create the resized versions of that image
– create the proper entries in the dB for that image
– create the proper entries for the association of that image with the postThese are the steps I’m trying to do
Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsI apologize if I came off as lazy, but I don’t think that asking about wordpress functions in the WP forums should be seen as lazy or should be the antithesis of reverse-engineering plugins.
I am asking about the internal structure of WP in WP forums because I’m trying to build something of my own and trying to dissect a plugin only to get to what functions to what really doesn’t seem like a productive approach.All I am trying to do is write a plugin to that:
– creates a post
– uploads an image
– creates the proper stuff in the dB for that image and the association of that image with the postI was inquiring whether these 3 (or more) functions to do these 3 tasks exist or if I need to write them from scratch…
Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsThanks for pointing me in the right direction.
Basically I am writing a script that will create a post with images and insert it into WP and I am hoping to find a way to use a WP function to create all the other data that’s required.
If I handle the upload of the file with my script, can I then use
wp_generate_attachment_metadata( int $attachment_id, string $file )
to create the metadata that goes in the dB?And is there a function that writes all the data created by
wp_generate_attachment_metadata( int $attachment_id, string $file )
into the dB or do I need to write a query for it?Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsThank you for your replies.
Can you successfully refer to an image in a post if there are not post_meta fields set or are those mandatory?
And lastly, is there a WP function I can pass an image to and let it create all of the different size images (based on the options you mention) and all of the post_meta data? Or do I need to write my own database queries for that?
Thanks so much
Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsI’ve read through those tickets and only have two followup questions:
1. what are the sizes of “standard” small, medium and large images that WP creates? is there a standard? I see on some posts it’s 555, on others 400 or 300…
2. besides the wp_posts table is there any other place in the database where there is an association between the post and the images in the post?
Forum: Fixing WordPress
In reply to: more info on image size calculations and class definitionsthank you Joy!
Forum: Developing with WordPress
In reply to: changing title to page in get_header()I’m not sure what you mean. Even if I added an iFrame to a WP page/post it still wouldn’t change the title of the page/post, in fact, since my content is in an iFrame the page that has the WP header would never even change…
Forum: Developing with WordPress
In reply to: changing title to page in get_header()sorry for misunderstanding…
sadly it’s impossible to load external content into WP when the external content is a fully fledged out script with its own database, queries etc… at least not to my knowledge… correct me if I’m wrong but I don’t think that can be done without a full rewrite of the script…
and if I’m right about this then I guess there is no way to change the title of the WP header that’s generated…