Hi, I am working on a WP theme with a friend and I'm trying to make it more widget-friendly but with twitter-tools after every link it adds a new line, how can I stop this? you can see a live version
thanks.
Hi, I am working on a WP theme with a friend and I'm trying to make it more widget-friendly but with twitter-tools after every link it adds a new line, how can I stop this? you can see a live version
thanks.
Note: @Member361407 later reported the issue went away after switching themes; had asked for a screenshot. That symptom points to two likely sources: the HTML itself contains line breaks (plugin or automatic formatting), or the theme CSS forces links onto their own lines. The following checklist isolates the cause and gives safe fixes.
First, inspect the markup in browser devtools and view-source for the tweet block. Look for literal <br> or <p> tags immediately after anchors, or check the computed display value for the links. If the links are rendered as non-inline elements, the visual break is purely CSS. See the CSS display reference: display — MDN.
If the DOM shows <br>/<p> after links, the output is being altered by a filter (WordPress wpautop) or by the plugin itself. The plugin page and wpautop docs are useful background: Twitter Tools plugin and wpautop() — WordPress Developer Reference. A minimal server-side cleanup (apply only to the plugin output) can remove stray break tags before echoing:
// get plugin output into $html_output (replace with the plugin's call)
$html_output = str_replace(array('<br>', '<br/>', '<br />'), '', $html_output);
$html_output = strip_tags($html_output, '<a><strong><em>'); // keep anchors and simple inline tags
echo $html_output; If CSS is the culprit, changing the display on the tweet container usually fixes it without touching plugin code:
#twitter-widget a,
#twitter-widget li a {
display: inline;
margin-right: 8px;
} Cautions: avoid editing plugin files directly; prefer filtering the plugin output in the theme or via a small mu-plugin. Removing wpautop globally with remove_filter('the_content','wpautop') will affect other content sitewide, so use scoped fixes and test on a staging copy before deploying.
Jump to Post— macneato 29I've tested ff, ie7 and 6. Can't see what you talking about. Wanna attach a screen?
I've tested ff, ie7 and 6. Can't see what you talking about. Wanna attach a screen?
Oh hey, I managed to fix it but I have changed theme. I meant to change this to solved. Thanks anyway.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.