digibucc
Forum Replies Created
-
Forum: Hacks
In reply to: Extract and resize a post attachmentyou’d have to pull post content instead of attachments. embedded is embedded, you can’t pull it out of your post as it doesn’t exist there, the best you can do is have it replicate the code it uses in
the post to display it elsewhere.making one area display both images and videos would be a bit of work.
Forum: Hacks
In reply to: root directory and index.htm title tagthat is more complicated than i thought, but my point was to find
where in the code it is over-riding the page title, and change it.you could still do that, but it’d be more difficult. sorry idk the program.
Forum: Hacks
In reply to: Customizing search pagebtw, i googled: “populate dropdown jquery”
and got a lot more info.
Forum: Hacks
In reply to: Customizing search pageit’s not something i have actually done yet, so i can’t be of a ton of help.
but this link has an example, which says to be resolved.
every solution seems to start with jquery, which if new to you is an
incredibly useful library of javascript functions. wordpress has a few
plugins that will integrate it properly, without any mess. you will
need it set up before and jquery code will work.Forum: Hacks
In reply to: root directory and index.htm title tagi use dreamweaver to search an entire directory for a string of text/code. i am sure there are free pieces of software that do the same.
search the whole directory for that text, and change it. obviously you
have performed a search on just the htm file first.Forum: Hacks
In reply to: Moving publish metabox from sidebar to bottom. How?you could just drag it? it will save the location wherever you leave it.
if you want it to be there by default, there are plugins that setup a default layout for the write screens. sorry idk offhand the names.
Forum: Hacks
In reply to: Custom profile fields validatorForum: Hacks
In reply to: Extract and resize a post attachmentthe one question that comes up for me is – how do you plan on selecting
a specific attachment without the url? you can use the resource id.you’d get attachment ids for the post(by post slug or id), then use the attachment id to find the filename.
one way to get the ids, though i thought there was an easier one – you can use get_children() with the parent id in it’s arg array. then you’d
need to choose which attachment. this page has examples.then you could use wp_get_attachment_url to return a url that can be used in your existing code.
good luck
Forum: Hacks
In reply to: Dropdown in Text widgetput your code in code brackets (‘ ‘) so we can see what it says
Forum: Hacks
In reply to: Add additional info to page/post in mySQL?found it!
in your header.php , you want to add this:
/* show me what the body class will look like */ echo body_class() . "\n"; /* make sure i've got $template */ global $template; /* print the active template path and filename */ print_r($template);
specifically the last two parts, you don’t necessarily need
the echo body_class bit.Forum: Hacks
In reply to: Add additional info to page/post in mySQL?the language for echoing the template is simple
echo $template;
or
<?php get_page_template() ?>
but putting it straight into your code view in
page editor doesn’t work, even with php enabled in it.Forum: Hacks
In reply to: Add additional info to page/post in mySQL?the page is assigned a template, it doesn’t use
it for creation. meaning the loop already knows
which template you used. there is code to echo
this , but i am sorry i don’t know it right off.as for custom post meta, it’s not bad.
google get_post_meta, the_meta, and add_post_meta.
the codex entries are the first result, and they
explain it well.Forum: Hacks
In reply to: Creating plugin, not showing up where I want it.that is correct.
as i said, use is_single in a simple matter, just to check where
it shows before testing your gplus code.if ( is_single() ) {
echo ‘only on a single post’;
}also, i would bet that if i simply move the is statement
mine will still working, meaning there is something else
we are missing.Forum: Hacks
In reply to: Creating plugin, not showing up where I want it.i did something similar, though not by creating a plugin, and not with the same neatness that you did. however, i better understood it compared to how well i understand your method.
for troubleshooting, make your is_single code do something simple, like echo hello. then you can be sure it is working at all.
my method for adding something in the body after the content was such:
function add_post_content($content) { if ( is_single() ) { $contemp = $content; $content = '[gallery]'; $content .= $contemp; } return $content; } add_filter('the_content', 'add_post_content');
i added the “[gallery]” shortcode, to be sure it showed properly on
every page. note, i re-arranged it though, so the shortcode came before the content. to do yours, i would do this:function add_post_content($content) { if ( is_single() ) { $gplus= '<a href="googleplus.com"><img src="gplus.jpg></a>'; $content .= $gplus; } return $content; } add_filter('the_content', 'add_post_content');
note, i didn’t know the link/image so you’d want to correct that.
Forum: Plugins
In reply to: Book Marksyou want to change “My Site” to the name of your site, as it should appear when they bookmark it.