Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

Jhowls on "Block sending for determined emails"


360zen on "How to force Tiny_MCE links to be relative"

$
0
0

Hi there,
I am in the process of setting up a WordPress installation that appears at two domains (i.e. http://example1.com and http://example2.com). I have managed to figure out how to switch the theme and the Site URL based on the SERVER_NAME. However, one of the few remaining problems is that links to existing content added by an user through the WYSIWYG editor still get the current site root added to them. So, if I am logged in to example1.com and add a link to an internal page through the "Existing Content" feature, "http://example1.com/" is appended to the beginning of the URL.

So, my question is, how do I stop this behavior? I would really like internal links to be relative to the Site URL of the visitor, not the Site URL of the author.

I have looked at two plugins (Relative URL and Root Relative URLs) and both of them are too broad. They change every URL on the site, which I don't need.

I've tried adding this to my functions.php, with no success:

function my_mce_setup( $init_array ) {
	$init_array['convert_urls'] = 'false';
	$init_array['relative_urls'] = 'true';

	return $init_array;
}
add_filter( 'tiny_mce_before_init', 'my_mce_setup' );

I'm assuming I'm missing something about how Tiny MCE settings are passed...
EDIT: I'm also not sure that the "Link to Existing Content" feature is even related to Tiny MCE.

Before you reply, please understand that I already know that I'm stretching WordPress beyond what it is "intended" to do. I'm aware that WordPress is designed to only support absolute URLs, but I still need a solution.

Thanks in advance for any help!

-Justin

MV789 on "Reduce width of site by decreasing left side column width"

$
0
0

Hi there,
A big thanks to the community for all their posts/support so far. Despite searching extensively through the posts/questions I have been unable to properly resolve my issue without causing additional problems. I am making changes using jetpack CSS. My goal is to:

1. Reduce the overall site width (beyond what I currently have done) but maintain the current width of my central column and right (content) sidebar.

To compensate for the reduction of total site width, I would like to reduce the width of my left sidebar AND its associated submenu items.

Currently I cannot reduce the width of the site much more using the below code without squishing the central column and right content sidebar:

/* This Block Adjusts the Overall Theme Width */
footer[role="contentinfo"] {
max-width: 1000px;
}

@media screen and (min-width: 1080px) {
.site {
max-width: 1000px;
}

.ie .site {
max-width: 1000px;
position: centre;
}

.site-header {
max-width: 1000px;
position: centre;
}
}
When I use the below code to adjust the left side bar width I have the issue of the submenu navigation widths remaining unchanged (too wide), and the horizontal lines that mark the space between pages of my menu remaining extended too far to the right(at their original length):
@media screen and (min-width: 1080px) {
.site:before {
width: 130px;
}
#secondary {
width: 130px;
}
}

I hope that my question makes sense and was asked according to forum rules.
Thanks for your help in advance!

My site can be view at http://www.LearningAT.ca

joshjosh on "Play Audio Reading of Text of Post and Have The Text Transform As It Is Read?"

$
0
0

Hello. Can anyone perhaps point me in the right direction about how I could play an audio reading of the text of a post, and have the words transform (change color, underline, bold, etc.,) as they are read, in-time or in-sync? I'm not sure what I need to learn in order to be able to do this. Any advice would be sincerely appreciated. Thanks!

Dervila on "Changing permalink in code"

$
0
0

I would like to change the permalinks for all custom posts of a certain type in a program. I have the hook I need, the function works, I see how to get the permalink, but I don't see how to change the permalink in a program.

serj.stratu on "wordpress render gallery html"

$
0
0

Hello guys
i want rewrite my galery html instead of the standard.

now i have this html

<dl class="gallery-item">
<dt class="gallery-icon landscape">
<a href="{image url}"></a>
</dt></dl>

but i want this html in gallery

<a href="{full_URL}" title="{TITLE}" data-thumbnail="{THUMBNAIL_URL}" data-description="{DESCRIPTION}">

DrMosko on "hello, i need to know is iframe from wordpress site remain in wordpress?"

$
0
0

what i see is the iframe not getting command line plugin_dir_path,
i'm trying to get the data from the iframe into the wordpress site , handle it and send it back again to the iframe - how do i do that, any suggestion will be kundlu accepted

Webmaster_crawl on "Page Load and Scroll from right to left"

$
0
0

I would like a wordpress page to load in background, then scroll right to left and come in viewport..

For example please see this link https://www.dropbox.com/guide/admin

On click of any link, the next page loads in background.. and the progress is shown on top, and then the page comes in viewport from right to left.

The question is, i can apply jquery to have that scroling effect, but that wud be possible when i have page already loaded but out of current viewport.

So how can i tweak to have the pages behave something like in above link ?? any pointer?
Thanks


Tim Brugman on "Adding links to internal pages by id"

$
0
0

Hi. This is my first discussion thread on WordPress functionality so let me know if this is not the right place or if I'm doing something wrong.

The other day I ran one of those online website optimizer tools on a client site of mine. One of the problems that came up was that the client filled the site with content on its staging platform and thus inside the body he had created permalinks to the staging site. When we launched the site I copied the database and taa-daa, the live site was linking to staging. Simple problem.

Plugins
Now there's plenty of plugins that can provide a solution. All of them create a shortcode, and most add a button to TinyMCE or some other new UI element so the user doesn't have to look up the id and post type of the post they want to link to and can link anything they want.

Pros: It works.
Cons: None of them add the UI to the existing 'insert/edit link' interface. That means I have to explicitly tell my client how to use it, and he has to remember to tell any and every moderator he adds. Or I have to remove the default TinyMCE buttons so there can be no confusion. Side question: Can the 'insert/edit link' window be modified with hooks?

Fill on production
It doesn't just have to be the production server it has to be the final production domain too. That means it wont work if there is still an old website on that location. Today most people getting a new website will already have an old one.

Index.php
The documentation provides a solution as well. We could link to index.php?p=6 or index.php?cat=7 or index.php?page_id=42 etc. I assume this also works with post types.

Pros: It works. No plugins needed.
Cons: There is no interface to make this easy for the user. A plugin would have to be made. The links also get published, so yes they work - but Google wont get to index your pretty permalinks.

Add it to core?
This I have no experience with. I couldn't find any places where this might have already been discussed in the past.

Arguments for:
I think it would be a good change to the way links work. Divide the interface into internal and external right away, when the user chooses internal the interface will generate a shortcode with the chosen target's id and post type. This would also require the core to process this shortcode by default, similar to the more-tag.
A posts' id and type are the only things that will always remain the same. It would make sense to use those to connect pages together instead of hoping nobody will change a linked posts' slug.

Arguments against:
When we change all internal links in post bodies with shortcodes it will undoubtedly require some extra queries so turn those into permalinks before spitting it out on the front end. Maybe this is not lean enough for core.
Only a small portion of WordPress users will be working with different environments. My reason for wanting this is maybe not big enough for a core addition.
This feature could also help when you change the base URL of your website. This should however also happen rarely so they same 'not enough demand' argument applies.

So those are my 2c on this tiny but integral subject. To summarize: Linking internally by id seems better to me. The existing plugins are not perfect. I don't know if a perfect plugin can be made for this and I don't know if this is a change worthy of suggesting for core.

I'd love to hear what you think.

tiofelix on "I'm trying to create a solution to upload images outside the wordpress server"

$
0
0

I'm not sure if this is the correct section of the forum to ask this but if i'm mistaken, please tell me where i should go and i can post it on the correct section.

I have a wp MU with many subsites, and on each subsite, people upload lots of images, everyday.

At this point you probably already guessed the server disk space won't handle it forever. The thing is... i can't also limit a "max space usage" on the network dashboard because their websites news must be updated almost everytime, and new pics come in.

Now, i'm trying to find (or maybe even create) a plugin which allows the user to upload the pictures on a image sharing service, but using the wordpress dashboard.

I've been using this old Wordpress Flickr Manager plugin for about 1 year or so. It kinda does its work fine, and we bought a premium account on flickr so basically we have unlimited space.

But this plugin is also old now, the author doesn't seem interested to update it, and i even had to do a url fix on the phpFlickr library it uses since Flickr changed their REST API urls.

So i ask for any ideas towards this problem. I can't find another flickr plugin that uploads through wp, neither have an idea of a better solution. Maybe another image sharing service? Maybe even a brand new approach to the problem? I'm out of ideas, and i appreciate any suggestion.

Thanks!

rafamadrile on "obtener variables get url wordpress"

$
0
0

Buenas.

Tengo un problema un poco complejo de explicar. Estoy montando un wordpress donde tengo una pagina (galerias), con una serie de fotos. Los enlaces permanentes estan configurados como "Nombre entrada". Para acceder a esta pagina la url es

http://www.midominio.com/galerias.

Lo que estoy intentando es pasar dos variables get con una estructura tipo
http://www.midominio.com/galerias/variable1/variable2

He realizado algunas pruebas en htaccess que no han funcionado.

RewriteRule ^galerias/([a-zA-Z0-9-]+)/([0-9]+)$ galerias/c=$1&f=$2 [L,NC]
- No se encontro la pagina
- se mantiene la url

RewriteRule ^galerias/([a-zA-Z0-9-]+)/([0-9]+)$ galerias/index.php?c=$1&f=$2 [L,NC]
- No se encontro la pagina pero llegan las variables
- se mantiene la url

RewriteRule ^galerias/([a-zA-Z0-9-]+)/([0-9]+)$ index.php?p=27c=$1&f=$2 [L,NC]
- Llega a la pagina galerias pero no llegan las variables
- redirije a http://www.midominio.com/galerias

Por anticipado,
Muchas gracias.

Dervila on "Need hook which fires when user hits "add new" button for custom post"

$
0
0

I want to run a function right after the user clicks on the "add new" button for a custom post. {$old_status}_{$new_status} won't help because those and their relations fire after the custom post is created. I need the function to run before the custom post is created.

Here's the detailed explanation: I have a list of members of a group, where the member custom post was created with the Pods plugin. My users are members of that group, and so have access to the list so they can create/modify/delete their data. Some of my users are barely computer literate, and easily confused. When a user hits the "add new" button, I want to be able to show them all the member names associated with their userid so they don't recreate an existing member.

I have looked all over the WordPress site, and even looked through the hooks listed for WordPress 3.9 on Adam Brown's site. I'm afraid I'm stuck.

Gone_is_my_name on "Adapt lenght of wordpress excerpt to screen width"

$
0
0

I'm making an WP theme, but I have a little problem. I want the length of excerpt (in carachters) to be adaptive to the screen width.

if screen width is bigger then 1000px, 20 characters
between 1000 and 700 it should be 5
between 700 and 640px, 20 chars
between 640 and 480, 5 chars
below 480px, 20 chars.
Hope that this makes sense. :)

I tried creating something in my functions.php. I used methods as:

function new_excerpt_length($length) {

if ((screen.width > 1024))
{
return 5;
}
else
{
return 15;
}
}
add_filter('excerpt_length', 'new_excerpt_length');

But that didn't work, it outputs the same number. CSS isn't a solution, has to be done in JS, in the functions.php file (no jQuery).

talk2ameya on "Facebook like button on homepage not expanding after click"

$
0
0

My website

I've put up the facebook like button (manually through code) beside the post date and comment count on the posts that are displayed on the homepage.

The button works perfectly, but when I click on it, it is ideally supposed to expand down fully to give me the option to add some text and post on facebook.

In my case, it expands, but only till the width of the button.
(You'll have to visit my site and see to understand what I'm talking about)

How do I get it to expand properly?

Here's my code in content.php:

<div class="entry-meta">
<?php hemingway_rewritten_posted_on(); ?>

<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>

<span class="comments-link"><span class="sep"> / </span>

<a href="<?php echo get_permalink($post->ID); ?>#fbcomments">
<fb:comments-count href="<?php echo get_permalink($post->ID); ?>">    </fb:comments-count>&nbsp;comments </a>

</span> <span class="sep"> / </span>

<fb:like href="<?php the_permalink() ?>" width="300" layout="button_count" action="like" show_faces="false" share="false"></fb:like>

<?php endif; ?>

<?php edit_post_link( __( 'Edit', 'hemingway-rewritten' ), '<span class="edit-link"><span class="sep"> / </span>', '</span>' ); ?>

</div><!-- .entry-meta -->

Saeed Salam on "Custom Calendar Widget"

$
0
0

Hello,

Am working on a site that lists historic moments.

it will have posts like "George Washington became the first president of USA on April 30, 1789"
it will be tagged with "April 30".

what i want to achieve is, when clicking on the April 30 in the Calendar Widget (on any year), it should open the archive page of "April 30" tag. is it possible? any plugin there to get it done? would be so grateful if someone can direct me to do it.

Thanks!


Number_6 on "Removing all taxonomy admin submenus"

$
0
0

Hello folks,

I have 6 post types and about 20 taxonomies relating to at least one of those post types. I find it easy to navigate the admin panel, but people who wish to work with me are intimidated by the visual pollution caused by the taxonomy submenus under each post type menu.

What generates these submenus and how could I efficiently omit them?

Ideally I'd like to give the taxonomies their own menu hierarchy, but I'll cross that bridge when I come to it.

Cheers.

Katrienmoore on "names for images with add media in posts and pages"

$
0
0

In posts or pages you can use the add media button. This opens a grid view of the media library but it does not show the names of theIimages. I have loads of similar images. I would need the names to be able to pick the right one. How do I display the names there or change the display to a list few

timotyh on "jQuery Issues"

$
0
0

I have searched the forums for this and can't seem to find anything that helps.

Basically I have used a plugin called Cube Portfolio, and it isn't working properly as there are 2 jQuery version and there clashing. I can cancel the 1.9.1 version as that is in the header.php, however I can not see where the 1.10.2 version is being called from.

If I delete the first version it breaks a lot of functionality on the homepage, but my portfolio blog works. I need to cancel 1.9.1 working on one page on this website. Is there a bit of code I can put in the head that will just cancel the 1.9.1 version out?

You can find the site here
And the page with the portfolio is here

All help is really appreciated!

baraklevy on "set upload folder to be on a cloud solution"

$
0
0

Hi
I am looking a long time for this solution.
Can I set my upload folder to be on a cloud (Dropbox or Google Drive)?
so each time I upload a file (Image, video or PDF) it will not upload to the site server - only to the cloud?
that if I open the media library it will show me the files on the cloud
and if I select a file - it will NOT download it from the cloud to the site server - it will add it to the content with the external file URL.

IS it possible?

floreal on "Does a Wordpress XML-RPC librabry exists in Qt/C++ ?"

$
0
0

Hi,

I am developping an application that help me posting in my wordpress blog.

My application is written in Qt/C++. Before, I have created this application in Java, and I used JWordpress (https://code.google.com/p/wordpress-java/) for send post in my blog, through XML-RPC protocol.

Now, I am translating this application in Qt/C++ for many reasons (the main reason: Qt/c++ is more beautiful, and more fluent than java).

All work well with the Qt/C++ version, but I don't find any equivalent for Qt/C++ ?

I find qxmlrpc (https://code.google.com/p/qtxmlrpc/), but it use only basic xmlrpc protocol and is not specific to wordpress.

I don't understand a lot how this protocol works for wordpress, so I search a library already existing...

Do you know an appplication that can help me for that ? Or do you know a full detailled manual that can help me to make it ? Because I am a full noob in that domain...

Thank you in advance for your help.

Floréal.

Viewing all 8245 articles
Browse latest View live




Latest Images